当前位置: 技术问答>java相关
jsp+resin+jdk1.4+win2000adv,连不上Access、sql server数据库
来源: 互联网 发布时间:2017-04-26
本文导语: 测试页面正常,测试数据库Access,用jdbc-odbc,dsn已经设置正确。 运行后,出现如下错误: 500 Servlet Exception java.sql.SQLException: General error at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6135) at sun.jdbc.odbc.JdbcOdbc.standard...
测试页面正常,测试数据库Access,用jdbc-odbc,dsn已经设置正确。
运行后,出现如下错误:
500 Servlet Exception
java.sql.SQLException: General error
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6135)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6263)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:2488)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:317)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:160)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at _testsqlserver3__jsp._jspService(/testsqlserver3.jsp:37)
at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
at com.caucho.jsp.Page.subservice(Page.java:497)
at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
at com.caucho.server.http.Invocation.service(Invocation.java:312)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:244)
at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:163)
at com.caucho.server.TcpConnection.run(TcpConnection.java:137)
at java.lang.Thread.run(Thread.java:536)
--------------------------------------------------------------------------------
Resin 2.1.6 (built Fri Nov 8 08:18:18 PST 2002)
是不是没有装驱动类,如何下载及安装?
分别连接sql server和access,如何连?
谢谢!
运行后,出现如下错误:
500 Servlet Exception
java.sql.SQLException: General error
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6135)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6263)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:2488)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:317)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:160)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at _testsqlserver3__jsp._jspService(/testsqlserver3.jsp:37)
at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
at com.caucho.jsp.Page.subservice(Page.java:497)
at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
at com.caucho.server.http.Invocation.service(Invocation.java:312)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:244)
at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:163)
at com.caucho.server.TcpConnection.run(TcpConnection.java:137)
at java.lang.Thread.run(Thread.java:536)
--------------------------------------------------------------------------------
Resin 2.1.6 (built Fri Nov 8 08:18:18 PST 2002)
是不是没有装驱动类,如何下载及安装?
分别连接sql server和access,如何连?
谢谢!
|
access的连接没有错.
在SQL server中把
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
改成
Statement stmt=conn.createStatement();试一下,
你的access也不能连上去吗?是上面的提示么?
在SQL server中把
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
改成
Statement stmt=conn.createStatement();试一下,
你的access也不能连上去吗?是上面的提示么?
|
用ODBC连不用再装驱动,你连数据库的代码呢?
|
贴源码