In an EJB or anything that needs a connection you need to look up the connection.
Something like the following:
...
private Connection dbCon = null;
private Connection getConnection()
{
if( dbCon == null )
{
try
{
InitialContext ic = new InitialContext();
DataSource ds = (DataSource)ic.lookup("java:/OracleDS");
dbCon = ds.getConnection();
}
catch( Exception e )
{
e.printStackTrace();
}
}
return dbCon;
}
...
Let me know if that is what you're looking for...
>*This message was transferred with a trial version of CommuniGate(tm) Pro*
>Hi Everyone;
>
>After you modify the jboss.jcml to include
><mbean code="org.jboss.jdbc.XADataSourceLoader"
>name="DefaultDomain:service=XADataSource,name=OracleDS">
> <attribute name="PoolName">OracleDS</attribute>
> <attribute
>name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImp
>l</attribute>
> <attribute
>name="URL">jdbc:oracle:thin:@serverhostname:1521:ORCL</attribute>
> <attribute name="JDBCUser">scott</attribute>
> <attribute name="Password">tiger</attribute>
></mbean>
>
>how do you access this connection pool in the client program??
>
>ps - does any one have an example of a client program for connection
>pooling??
>Thank
>
>-Lan
>
>
>_______________________________________________
>JBoss-user mailing list
>[EMAIL PROTECTED]
>http://lists.sourceforge.net/lists/listinfo/jboss-user
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user