Subject RE: [Firebird-Java] Error runing java program
Author Bayu
Sorry,

I was not include mini-j2ee.jar. Problem is solved..

> -----Original Message-----
> From: Bayu [mailto:bayu@...]
> Sent: Saturday, February 22, 2003 8:11 AM
> To: firebird-java@yahoogroups.com
> Subject: [Firebird-Java] Error runing java program
>
>
> Hi all
>
> I have a sample code in java like this ( taken from developer.java.sun.com
> and modified small )
>
>
> import java.sql.*; //import all the JDBC classes
>
> public class CreateJoltDataFB {
>
> static String[] SQL = {
> "create table JoltData ("+
> "programmer varchar (32),"+
> "day varchar (3),"+
> "cups integer);",
> "insert into JoltData values ('Gilbert', 'Mon', 1);",
> "insert into JoltData values ('Wally', 'Mon', 2);",
> "insert into JoltData values ('Edgar', 'Tue', 8);",
> "insert into JoltData values ('Wally', 'Tue', 2);",
> "insert into JoltData values ('Eugene', 'Tue', 3);",
> "insert into JoltData values ('Josephine', 'Wed', 2);",
> "insert into JoltData values ('Eugene', 'Thu', 3);",
> "insert into JoltData values ('Gilbert', 'Thu', 1);",
> "insert into JoltData values ('Clarence', 'Fri', 9);",
> "insert into JoltData values ('Edgar', 'Fri', 3);",
> "insert into JoltData values ('Josephine', 'Fri', 4);",
> };
>
> public static void main(String[] args) {
> String URL =
> "jdbc:firebirdsql.localhost:e:\\projects\\java\\jdbc\\cofeebreak.gdb";
> String username = "sysdba";
> String password = "masterke";
>
> try {
> Class.forName("org.firebirdsql.jdbc.FBDriver");
> } catch (Exception e) {
> System.out.println("Failed to load JDBC/ODBC driver.");
> return;
> }
>
> Statement stmt = null;
> Connection con=null;
> try {
> con = DriverManager.getConnection (
> URL,
> username,
> password);
> stmt = con.createStatement();
> } catch (Exception e) {
> System.err.println("problems connecting to "+URL);
> }
>
> try {
> // execute SQL commands to create table, insert data
> for (int i=0; i<SQL.length; i++) {
> stmt.execute(SQL[i]);
> }
> stmt.close();
> con.close();
> } catch (Exception e) {
> System.err.println("problems with SQL sent to "+URL+
> ": "+e.getMessage());
> }
>
> }
> }
>
> I execute with sintax java -classpath %classpath% CreateJoltDataFB then
>
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> javax/resource/Resour
> ceException
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:140)
> at CreateJoltDataFB.main(CreateJoltDataFB.java:29)
>
> I trace in rt.jar on my j2sdk1.4.1_01 distro the
> javax/resource/ResourceException doesn't exist.
>
> There is miss files or i have no classpath enough ?
>
> Thanks for your reply...
>
> rgrds
> Bayu
>
>
>
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>