This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / java程序中装载DB2 通用JDBC 驱动程序的问题,很急很急1。想在java程序中访问db2数据库(windows平台),是不是可以选择type 4:db2 Universal JDBC driver?或者应该选别的type?
2。编译通过后,为什么运行时语句Class.forName("com.ibm.db2.jcc.DB2Driver");总是报错说找不到class:com.ibm.db2.jcc.DB2Driver?(已经import java.sql.*;)
拜托有java+db2经验的朋友指点一下,多谢!
-ckzn(nancy);
2004-2-6
{311}
(#1593454@0)
-
1.只有UDB8有type 4 driver. UDB 7 only has type 2 and type 3 driver. 2. Check your classpath, DB2install/sqllib/java/db2jave.zip should be in your classpath
-deepblue(Shopping...);
2004-2-6
(#1593468@0)
-
多谢!那是不是说我可以用type 2,如果只做application的话?是com.ibm.db2.jdbc.app.DB2Driver吗?还有,db2java.zip在那里,没问题。
-ckzn(nancy);
2004-2-6
(#1593477@0)
-
哎呀,换成com.ibm.db2.jdbc.app.DB2Driver还是报找不到class!这个class应该在哪个目录下呢?我的db2java.zip文件是在你说的目录下面。
-ckzn(nancy);
2004-2-6
(#1593485@0)
-
app driver is included in db2java.zip. Did you check your classpath? db2java.zip should be included in your classpath.
-deepblue(Shopping...);
2004-2-6
(#1593488@0)
-
how to check classpath? (sorry i'm a beginner on java)
-ckzn(nancy);
2004-2-6
(#1593498@0)
-
Windows Start menu "Run"->cmd-> set clssspath=db2installfolder/sqllib/java/db2java.zip;%CLASSPATH%-> set classpath-> check the output->java YOURAPPLICATION
-deepblue(Shopping...);
2004-2-6
(#1593517@0)
-
after i set it and run set classpath to check output, i found that there's two settings about db2java.zip. so i guess this classpath has already been there beore. but why java still couldn't find class?
-ckzn(nancy);
2004-2-6
(#1593532@0)
-
How do you run your java program?If you are using IDE, another story.
-deepblue(Shopping...);
2004-2-6
(#1593547@0)
-
i compiled java source code with tool TextPad. then run java program in cmd. btw, i checked the classpath in environment setting(win2000), db2java.zip has been there.
-ckzn(nancy);
2004-2-6
(#1593554@0)
-
I can't believe it! when i tried to change com.ibm... to COM.ibm..., program can run without exception.
-ckzn(nancy);
2004-2-6
(#1593565@0)
-
it seems everything is ok till now, great thanks for your help. have a nice day!
-ckzn(nancy);
2004-2-6
(#1593577@0)
-
是不是说要查autoexec.bat里面的classpath呀
-ckzn(nancy);
2004-2-6
(#1593504@0)
-
把这个path写到你的classpath 里。
-oxknife(闲人——瞎忙!!!);
2004-2-6
(#1593489@0)
-
win2000下面怎么加classpath呀?
-ckzn(nancy);
2004-2-6
(#1593513@0)