Connect to DB2 from inside Oracle
599114Sep 20 2007 — edited Jul 1 2013Hi.
I am trying to to connect to DB2 v9.0 database from Oracle 10g R2. I've got the jar files db2jcc.jar and db2jcc_license_cu.jar as IBM says we need.
I loaded this files with loadjava to scott/tiger almost without problems. Also I loaded slqj.zip file. I've got only 3 objects inavlid after loading.
The problem comes with my stored procedure in Java that I call from PLSQL.
In statement Class.forName ("com.ibm.db2.jcc.DB2Driver"); it gives me this error:
ava.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:165)
at com.ibm.db2.jcc.DB2Driver.class$(DB2Driver.java:48)
at com.ibm.db2.jcc.DB2Driver.<clinit>(DB2Driver.java:51)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:165)
at TestDB2.DepartmentDescription(TestDB2.java:26)
Caused by: java.lang.NullPointerException
at java.util.StringTokenizer.<init>(StringTokenizer.java:146)
at java.util.StringTokenizer.<init>(StringTokenizer.java:162)
at com.ibm.db2.jcc.c.o.i(o.java:347)
at com.ibm.db2.jcc.c.o.h(o.java:338)
at com.ibm.db2.jcc.c.o.<clinit>(o.java:322)
... 7 more
I tried putting into CLASSPATH the db2jcc.jar and db2jcc_license_cu.jar files, but with no results.
Somebody has done something similar. There is someting missing ?