ORACLE DB DRIVER : oracle.jdbc.driver.OracleDriver
ORACLE DB URL : jdbc:oracle:oci8:@testserver
ConnectionPool Name : myPool
Weblogiv Server Version : 4.5.1 Service Pack - 8
JDK Version -1.2.1 from Sun
Here is my Java Code (I followed the Using JTS guide for 4.5.1):
String JNDI_FACTORY = "weblogic.jndi.WLInitialContextFactory";
String JTS_USER_XACT = "javax.jts.UserTransaction";
System.out.println( "obtaining initial context ..." );
Properties cprop = new Properties( );
cprop.put( Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY );
cprop.put( Context.PROVIDER_URL, "t3://localhost:9260" );
cprop.put(Context.SECURITY_CREDENTIALS, new
T3User("myname","password"));
try {
Context ctx = new InitialContext( cprop );
System.out.println( "obtaining user transaction ..." );
UserTransaction xact = (UserTransaction)ctx.lookup( JTS_USER_XACT );
System.out.println( "transaction begin ..." );
xact.begin( );
driver = (Driver) Class.forName
("weblogic.jdbc.jts.Driver").newInstance();
Properties props = new Properties ();
props.put ("connectionPoolID", "myPool");
conn = driver.connect ("jdbc:weblogic:jts",props);
System.out.println( "creating connection ..." + conn);
When I run the above program I am getting the following exception:
java.sql.SQLException: java.lang.NullPointerException
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Exception.java:42)
at java.sql.SQLException.<init>(SQLException.java:82)
at weblogic.jdbcbase.jts.Driver.connect(Driver.java:289)
at JtsTest.main(JtsTest.java:79)
Any help is greatly appreciated!
Thanks
-muruga