Accessing connection pool of JBoss using session bean
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sanju_thomas
Posted On:   Wednesday, March 17, 2004 11:23 PM

hi,


The problem is very very simple, i have a connecion pool in JBoss named OracleDB, yes it is an oracle8i connection pool, can i access this connection pool using a stateless session bean, if can , pleas send me the details


with thanx

Re: Accessing connection pool of JBoss using session bean

Posted By:   R_H  
Posted On:   Friday, March 19, 2004 04:05 PM


I assume you are trying to use Jboss datasource (oracle db).

1. setup resource ref if ejb-jar.xml of your bean


jdbc/DataSourceName
javax.sql.DataSource
Container


2. set jndi name of real datasource in file jboss.xml of your bean


jdbc/DataSourceName
java:/your_datasource_name


3.
now lookup datasource in your session bean.

Context context = new InitialContext();
Connection con = (DataSource) context.lookup("java:comp/env/jdbc/DataSourceName");

About | Sitemap | Contact