How to use connection pooling in Jboss

2019-07-24 03:43发布

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条回答
Fickle 薄情
2楼-- · 2019-07-24 04:43

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(); 
查看更多
登录 后发表回答