(1) Firstly got: "Error was: java.sql.SQLException: No suitable driver."
Fixed this by changing:
Class.forName(driver);
to
Class.forName(driver).newInstance();
(2) Next problem was unsatsified link error to db2jdbc. Fixed this by
adding LD_LIBRARY_PATH to environment pointing to sqllib/lib
(3) Now get: java.sql.SQLException: [IBM][JDBC Driver] CLI0647E Error
allocating DB2 environment handle, rc=db2jdbc..
and this has got me beat. Searching around finds nothing. Can't find that
CLI error number in IBM error docs.
I have to upgarde to Fix Pack3 so I'll see if that sorts it (but not
hopefull). Would love to know if anybody else has come across this. Any
advice appreciated.
Cheers
Kit Kline
Kit Kline wrote:
--
Larry Menard
IBM Workstation Database (DB2) Performance Team
Defender of Geese and of all things Natural
--
Posted via dBforums
http://dbforums.com
Here's the full message:
db2 ? CLI0647E
CLI0647E Error allocating DB2 environment handle. Return code =
"<return-code>".
Explanation: The DB2 CLI environment could not be established.
User Response: Ensure your application environment is configured
correctly to use DB2. On UNIX platforms, ensure that the
sqllib/db2profile script has been run to set your environment
variables. To interpret the return code, refer to the CLI Guide
and Reference section on SQLAllocHandle().
Dirk
Yes,I am using DB2 v7.1 on AIX with JDK1.2.2. I checked db2profile in
/home/db2inst1/sqllib, but it seems written
correctly,LIBPATH,DB2INSTHOME and so on. So I think db2profile is not
loaded correctly.
Now I am testing with simply JAVA program to confirm connection
through JDBC Driver. I am using JDBC Driver in DB2 then classpath is
there, but at first loading Driver:
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver").newInstance(); Then I
got this error. When I did not add .newInstance(), loading seems
well( did not get any error), then connect will fail with "No
Suitable Driver".
If anyone knows some solution,please teach me. Any comment appreciated.