Subject NullPointerException opening a connection in standalone JDBC program
Author thomas_hays
I get this error in a standalone test program (see bottom of posting)
when opening a connection to the database. This error does not happen
with the 1.0 beta 1 driver but does with today's (8/21) CVS download.

The error is shown below:

Exception in thread "main" java.lang.NullPointerException
at
org.firebirdsql.jca.FBManagedConnectionFactory.cre
ateDbHandle(FBManagedConnectionFactory.java:515)
at
org.firebirdsql.jca.FBManagedConnectionFactory.ass
ureDbHandle(FBManagedConnectionFactory.java:525)
at
org.firebirdsql.jca.FBManagedConnection.<init>(FBM
anagedConnection.java:113)
at
org.firebirdsql.jca.FBManagedConnectionFactory.cre
ateManagedConnection(FBManagedConnectionFactory.java:346)
at
org.firebirdsql.jca.FBStandAloneConnectionManager.
allocateConnection(FBStandAloneConnectionManager.java:109)
at org.firebirdsql.jdbc.FBDataSource.getConnectio
n(FBDataSource.java:121)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:258)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at tdh.main(tdh.java:22)


Here is a test program that causes the error:

/*BEGIN SAMPLE PROGRAM*/
import java.sql.*;
import org.firebirdsql.jdbc.*;
import org.firebirdsql.logging.Logger;

public class tdh {

public static void main(String args[]) {

Connection con;

try {
Class.forName("org.firebirdsql.jdbc.FBDriver");
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}


try {
con = DriverManager.getConnection
("jdbc:firebirdsql:localhost/3050:/opt/interbase/db/tdh.gdb","sysdba",
"masterkey");

con.close();

} catch(SQLException ex) {
System.err.print("SQLException: ");
System.err.println(ex.getMessage());
}
}
}
/*END SAMPLE PROGRAM*/

No errors are encountered when compiling the sample.


Operating System: Linux Red Hat 7.2 i386

Java version:
java version "1.4.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)

CLASSPATH=.:/usr/local/jars/firebirdsql.jar:/usr/l
ocal/jars/mini-j2ee.jar

Since I'm using Java 1.4, it's my understanding that I don't need
JDBC, jaas, or anything else in my CLASSPATH, is that right?

Anyone have any ideas or suggestions (my apologies if it's my goof).

Thanks.