简体   繁体   中英

Java to DB2 Connection

I'm trying to connect to DB2 from JCreator. I have ClassPath Environment variable set to :

.;C:\\PROGRA~1\\IBM\\SQLLIB\\java\\db2java.zip;C:\\PROGRA~1\\IBM\\SQLLIB\\java\\db2jcc4.jar;C:\\PROGRA~1\\IBM\\SQLLIB\\java\\sqlj.zip;C:\\PROGRA~1\\IBM\\SQLLIB\\java\\db2jcc_license_cu.jar;C:\\PROGRA~1\\IBM\\SQLLIB\\bin;C:\\PROGRA~1\\IBM\\SQLLIB\\java\\common.jar;C:\\Program Files (x86)\\Java\\jre7\\lib\\ext\\QTJava.zip

Class.forName("com.ibm.db2.jcc.DB2Driver") throws ClassNotFoundException .

I am using windows 7 64 bit.

Please help!

Please post all stackTrace. Common situation is, that class is not in jar! Open your jar with driver and check, if class is there. I check it for you. db2jcc4.jar contains db2jcc4.jar\\COM\\ibm\\db2\\jcc\\DB2Driver. But the COM is Capital letters. Try use -cp or just copy jar with db driver to same foler closed to your app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM