java 連結sql server 2000 問題
java 連結sql server 2000 總結
Context envContext = (Context)initCtx.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/jieba");
conn = ds.getConnection();
執行後總是出現:
java.lang.NoSuchMethodError: com.microsoft.util.UtilDebug.setPrintWriter(Ljava/io/PrintWriter;)V
at com.microsoft.jdbc.base.BaseDriver.setupDebugging(Unknown Source)
at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at com.hero.analysis.service.base.DBConnection.getConnection(DBConnection.java:41)
at com.hero.analysis.service.base.JDBCFacade.getDataSource(JDBCFacade.java:72)
at com.hero.analysis.service.base.JDBCFacade.
at com.hero.analysis.dao.mysql.MysqlUserDAO.login(MysqlUserDAO.java:50)
at com.hero.analysis.service.UserBO.login(UserBO.java:27)
at com.hero.analysis.web.user.LoginAction.execute(LoginAction.java:39)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.hero.analysis.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:121)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.hero.analysis.util.CheckLoginFilter.doFilter(CheckLoginFilter.java:90)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
跟著程式走了以下,確實沒有這個方法,鬱悶了一天
經過反覆除錯後發現有幾種可能造成這個原因
1.驅動程式的版本不對
2 .sql server 2000沒有打補丁 必須打補丁
3 .檢查sql server 2000 的驅動程式mssql.jar,msbase.jar,mssqlserver.jar,msutil.jar存放位置對不對,一般放在tomact/commen/lib下就可以,或放進class_path,或webinfo/lib下,一般情況下,放一個地方就可以了
4 .位置方對了還不行 那可以考慮jdbc驅動程式的版本對不對,如果你打了 sp2補丁 那麼也要用for sp2 driver
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/750220/viewspace-912034/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 不同網段sql server 2005 連線 sql server 2000的問題SQLServer
- 安裝與ms sql server2000連線問題?SQLServer
- SQL Server 2000 許可權問題SQLServer
- SQL Server2000 許可權問題SQLServer
- 深入探索MS SQL Server 2000網路連線的安全問題 (轉)SQLServer
- 用Java連線SQL Server2000資料庫JavaSQLServer資料庫
- SQL Server連線SQL Server、SQL Server連線ORACLE 連結伺服器SQLServerOracle伺服器
- SQL Server 2000中的資料同步問題SQLServer
- SQL Server2000表複製的原理問題SQLServer
- 怎麼解決SQL server 2000的中文問題?SQLServer
- SQL Server 2000 死鎖(dead lock) 問題解決SQLServer
- Hibernate配置連線SQL SERVER2000SQLServer
- SQL Server中GROUP BY(連結)SQLServer
- 《轉》Sql Server 2005(64位) 連線Sql Server 2000(32位) .SQLServer
- [求助]JSP連線SQL Server 2000問題,看了很多資料還未解決,求救!JSSQLServer
- oracle 11g gateway 連線sql server 2000OracleGatewaySQLServer
- 檢測和解決 SQL Server2000 SP4中問題SQLServer
- 在SQL Server 2000中設定OPTION (MAXDOP 1) 效能提高問題SQLServer
- 求助:為什麼用jbuilder連sql2000出問題UISQL
- 討論java與sql server相容性問題JavaSQLServer
- java連線sql2005問題JavaSQL
- 在安裝有sql server2000的基礎上裝sql server 2005遇到的問題SQLServer
- sql server left join問題SQLServer
- DataGrid與SQL Server 2000資料繫結SQLServer
- SQL SERVER 登入問題!該使用者與可信的Sql Server連線無關聯SQLServer
- 測試sql server全文索引,結果遇到問題SQLServer索引
- SQL Server 2008連線區域網內的SQL Server 2000資料庫SQLServer資料庫
- SQL Server 2000 shrink tempdbSQLServer
- SQL Server 2005無法遠端連線的問題SQLServer
- ----------------SQL Server2000中死鎖經驗總結 ---------------SQLServer
- 配置sql server 2000以允許遠端訪問SQLServer
- SQL Server常見問題收集SQLServer
- sql server死鎖的問題SQLServer
- SQL Server許可權問題SQLServer
- 安裝 SQL 2000掛起問題SQL
- 請問JDON下 如何連線SQL SERVER???SQLServer
- [zt] SQL Server 2000複製SQLServer
- SQL SERVER 2000 解除安裝SQLServer