Subject RE: [Firebird-Java] error message with the jdbc 4 driver.
Author Sachin Walia
Add mini-j2ee.jar to the classpath as driver is also looking for the j2ee connector classes.
 
sachin
-----Original Message-----
From: chc_225 [mailto:chc_225@...]
Sent: Friday, October 25, 2002 7:58 AM
To: Firebird-Java@yahoogroups.com
Subject: [Firebird-Java] error message with the jdbc 4 driver.

Hello,

I am having the following error when I try to use the jdbc 4 driver.
I am using j2sdk1.4.0
Can anyone please help me fix the error message.

thanks
---------------------------------------------------------

F:\practice>d:\j2sdk1.4.0\bin\java TstFb
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:130)
        at TstFb.main(TstFb.java:15)


F:\practice>set classpath
CLASSPATH=G:\fbjdbc\firebirdsql.jar; G:\fbjdbc; D:\j2sdk1.4.0\bin;
D:\j2sdk1.4.0
\lib; D:\j2sdk1.4.0\jre\lib;



----------------------------------------------------------------
import java.sql.*;

public class TstFb
{
  public static void main(String args[])
  {
     String lname = null;
     String fname = null;
     Connection con;
     Statement sment;
     ResultSet rs;

     try
        {
         Class.forName("org.firebirdsql.jdbc.FBDriver");
         con = DriverManager.getConnection
("jdbc:firebirdsql://localhost/3050:Ibaccess.gdb", "SYSDBA", "masterke
y");
       
         String sql = "SELECT lname, fname FROM customer WHERE custno
= 3";

         sment = con.createStatement();

         rs = sment.executeQuery(sql);

         if ( rs.next() )
           { lname = rs.getString("lname");
            fname = rs.getString("fname");
           }
         rs.close();
         sment.close();
         con.close();

        }

     catch ( ClassNotFoundException cnfe )
        {
          System.err.println("Couldn't locate the driver
class: "+cnfe);
        }
     catch ( SQLException se )
        {
          System.err.println("Exception creating the database
connection: "+se);
        }


   

  } // main

} // CLASS






To unsubscribe from this group, send an email to:
Firebird-Java-unsubscribe@yahoogroups.com



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.