db2 express C connection [message #25065] |
Sun, 07 January 2007 05:30  |
Eclipse User |
|
|
|
Originally posted by: prog.kv.aon.at
I have got eclipse 3.2.1, DB2 DWB, and DB2 express C installed. With the
connection wizard the connection to the database xxdat can be set up, but
when I try to get a connection by using
Class.forName("com.ibm.db2.jcc.DB2Driver"); it does not work.
as classpathvariables i configured:
c:\Programme\IBM\DWB\V9.1\dwb_prod\eclipse\plugins\com.ibm.d atatools.db2_1.0.0\driver\db2jcc.jar;
c:\Programme\IBM\DWB\V9.1\dwb_prod\eclipse\plugins\com.ibm.d atatools.db2_1.0.0\driver\db2jcc_license_cisuz.jar
when I execute
Class.forName("com.ibm.db2.jcc.DB2Driver");
String urlLWn = "jdbc:odbc:xxdat";
Connection conXXdat = DriverManager.getConnection(urlLWn);
the exception "java.lang.ClassNotFoundException:
com.ibm.db2.jcc.DB2Driver" is thrown.
Can someone help?
Thanks for any hints,
Karl-Heinz
|
|
|
Re: db2 express C connection [message #25910 is a reply to message #25065] |
Tue, 23 January 2007 16:55  |
Eclipse User |
|
|
|
Originally posted by: ldunnel.us.ibm.com
The connection wizard explicitly loads the jars into a classloader. For
example,
ClassLoader myLoader = new URLClassLoader(urls,
getClass().getClassLoader());
(Driver) myLoader.loadClass("com.ibm.db2.jcc.DB2Driver").newInstance();
Then you can use the driver to connect.
|
|
|
Re: db2 express C connection [message #584151 is a reply to message #25065] |
Tue, 23 January 2007 16:55  |
Eclipse User |
|
|
|
The connection wizard explicitly loads the jars into a classloader. For
example,
ClassLoader myLoader = new URLClassLoader(urls,
getClass().getClassLoader());
(Driver) myLoader.loadClass("com.ibm.db2.jcc.DB2Driver").newInstance();
Then you can use the driver to connect.
|
|
|
Powered by
FUDForum. Page generated in 0.02839 seconds