久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

websphere與mysql連接的示例分析

167次閱讀
沒有評論

共計 4090 個字符,預(yù)計需要花費 11 分鐘才能閱讀完成。

這篇文章給大家分享的是有關(guān) websphere 與 mysql 連接的示例分析的內(nèi)容。丸趣 TV 小編覺得挺實用的,因此分享給大家做個參考,一起跟隨丸趣 TV 小編過來看看吧。

我是 jb9+websphere,想用 JNDI 訪問 mysql  
  在 http://localhost:9090/admin 我配置如下  
  在 jdbc 提供程序里設(shè)置  
  類路徑:D:mysqldrivermysql-connector-java-3.0.11-stable-bin.jar  
  實現(xiàn)類名為:com.mysql.jdbc.Driver  
  然后在數(shù)據(jù)源設(shè)置: 
  名稱:DataSource  
 JNDI:jdbc/DataSource  
  最后在定制屬性增加(這地方我刪增了好多次,就是沒效果): 
 databaseName–info  
 user-root  
 password–blue  
 url–jdbc:mysql://localhost/info  
 portNumber–3306  
 ConnectionURL–jdbc:mysql://localhost/info  
  使用連接代碼如下  
 private   final   static   String   JNDI= jdbc/DataSource  
 InitialContext   ctx=new   InitialContext();  
 DataSource   source=(DataSource)ctx.lookup(JNDI);  
 conn   =   source.getConnection();  
  結(jié)果 source 不為空,但是 conn 出現(xiàn)錯誤如下: 
  我不知道哪里錯了,從昨天一直調(diào)到今天,websphere 控制臺打印功能又非常弱 (system.out 看不到出錯信息,真是郁悶!) 
  實在不知道該怎么處理,懇請大蝦指導(dǎo)一下,非常感謝! 
 java.sql.SQLException:   DSRA9002E:   ResourceException   帶有錯誤代碼   null: 
 javax.resource.spi.ResourceAllocationException:    
 Caught   ResourceException   thrown   during   creation   of   the   ManagedConnection.    
 at   com.ibm.ejs.j2c.poolmanager.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:1151)    
 at   com.ibm.ejs.j2c.poolmanager.FreePool.createOrWaitForConnection(FreePool.java:908)    
 at   com.ibm.ejs.j2c.poolmanager.PoolManager.reserve(PoolManager.java:1067)    
 at   com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:568)    
 at   com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:378)    
 at   com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:205)    
 at   com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:180)    
 at   testwebsphere.web.DataBaseFacade.getUserinfo(DataBaseFacade.java:22)    
 at   org.apache.jsp._index._jspService(_index.java:112)    
 at   com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)    
 at   javax.servlet.http.HttpServlet.service(HttpServlet.java:853)    
 at   com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)    
 at   com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:598)    
 at   com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:696)    
 at   javax.servlet.http.HttpServlet.service(HttpServlet.java:853)    
 at   com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)    
 at   com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)    
 at   com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)    
 at   com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)    
 at   com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:258)    
 at   com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)    
 at   com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)    
 at   com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:872)    
 at   com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:491)    
 at   com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:173)    
 at   com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)    
 at   com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:199)    
 at   com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)    
 at   com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)    
 at   com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:331)    
 at   com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)    
 at   com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:432)    
 at   com.ibm.ws.http.HttpConnection.run(HttpConnection.java:343)    
 at   com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:592)[@more@]

感謝各位的閱讀!關(guān)于“websphere 與 mysql 連接的示例分析”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,讓大家可以學(xué)到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!

正文完
 
丸趣
版權(quán)聲明:本站原創(chuàng)文章,由 丸趣 2023-07-27發(fā)表,共計4090字。
轉(zhuǎn)載說明:除特殊說明外本站除技術(shù)相關(guān)以外文章皆由網(wǎng)絡(luò)搜集發(fā)布,轉(zhuǎn)載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 鹤山市| 珲春市| 商水县| 南充市| 乌兰县| 芦溪县| 营山县| 调兵山市| 蓬莱市| 义马市| 古蔺县| 同江市| 尼木县| 林周县| 仙游县| 新沂市| 凤庆县| 同江市| 从江县| 五台县| 南通市| 和田县| 泽州县| 罗江县| 宁陕县| 仁怀市| 汤阴县| 石楼县| 常熟市| 承德市| 澄城县| 邳州市| 明光市| 蓬溪县| 射洪县| 苍溪县| 鹿邑县| 怀宁县| 鄂伦春自治旗| 博客| 墨竹工卡县|