jdbc与db2连接,可是有一句总报错(代码如下),为什么?在线等候,谢谢!

nini111 2002-03-14 11:22:42
<%@ page import = "java.sql.*" %>
<%@ page import = "javax.sql.*" %>

<%!
Connection tConnection;
%>
<%
try{
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
tConnection = DriverManager.getConnection("jdbc:db2:test");//, tUser, tPassWord
/*** Statement tStmt = tConnection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
***/
ResultSet tRs = tStmt.executeQuery("select * from b2bfuncreq");
while(tRs.next()) {
out.println(tRs.getString(1));
out.println(tRs.getString(2));
out.println(tRs.getString(3));
}
tConnection.close();
}
catch (Exception e) {
if (tConnection != null)
tConnection.close();
out.println("Exception caught: " + e);
}
%>
...全文
52 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
simoncn 2002-04-09
  • 打赏
  • 举报
回复
You are using JDBC2.0 feature?
You must enable DB2 with JDBC2.0 feature first, go to SQLLIB\java12 execute usejdbc2.bat.
HowHowHow 2002-04-08
  • 打赏
  • 举报
回复
up

23,407

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧