How to use connection pooling in Jboss

自古美人都是妖i 提交于 2019-12-11 06:16:17

问题


I am supposed to use JBoss connection pooling for my application.Right now I don't have any idea about that. I Googled but couldn't get any good link.
Can you please share any good link which describes how to define data source, create and use connections in Java ?


回答1:


Probably this is what you r looking for: http://www.coderanch.com/t/89511/JBoss/Connection-Pooling

This snippet returns the database connection as declared in the xml fragment:

InitialContext jndiCntx = new InitialContext();  
DataSource ds = (DataSource)jndiCntx.lookup("java:/yourdsname"); 
connection = ds.getConnection(); 


来源:https://stackoverflow.com/questions/6993807/how-to-use-connection-pooling-in-jboss

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!