Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.sql.Connection object is null

843854Oct 14 2002 — edited Oct 15 2002
I think I'm able to connect to Oracle from HP-UX 11 using an OCI driver. However, the following line of code is causing a NullPointerException:

oraCallStmt = (OracleCallableStatement)conn.prepareCall( "{exec sp_package.sp_name(?,?,?,?,?)}" );

I believe this is because the conn object was never created and is therefore null. Here is the Connection statement which seems to execute fine:

Connection conn = DriverManager.getConnection("jdbc:oracle:oci:@ORACLE_SID", "user", "passwd");

The runtime error I'm getting is:

Exception in thread "main" java.lang.NullPointerException

Has anyone solved this issue? Thanks.

- Rajesh Vasisht
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 12 2002
Added on Oct 14 2002
2 comments
997 views