Subject | Re: [Firebird-Java] Error runing java program |
---|---|
Author | Javier Soques |
Post date | 2003-02-22T23:30:37Z |
You need the mini-j2ee.jar in your classpath.
Bye
Javier
--- Bayu <bayu@...> wrote:
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
Bye
Javier
--- Bayu <bayu@...> wrote:
> Hi all"jdbc:firebirdsql.localhost:e:\\projects\\java\\jdbc\\cofeebreak.gdb";
>
> 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 =
>
> 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
>
>
>
> ------------------------ Yahoo! Groups Sponsor
>
> 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/
>
>
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/