File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes JBOSS connection pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JBOSS connection pooling" Watch "JBOSS connection pooling" New topic
Author

JBOSS connection pooling

Mike Blair
Greenhorn

Joined: Sep 10, 2003
Posts: 19
I am trying to get a simple session bean to access my oracle DB. I can't figure out what all needs to be setup for the JBOSS connection pooling. My java code looks as follows:
DataSource dataSource = (DataSource) (new InitialContext()).lookup( "java:comp/env/jdbc/REGENT" );
Connection con = dataSource.getConnection();
Statement stmt = con.createStatement();
I have this wrapped in a try-catch and the error being returned is "JDBC not bound".
I guess my issue is not knowing what all xml files need setup for jndi to work properly. Here is what I think :
add to web.xml
<resource-ref>
<description>Regent Datasource</description>
<res-ref-name>jdbc/REGENT</res-ref-name>
<res-type> javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
add to ejb-jar.xml
<resource-ref>
<res-ref-name>jdbc/REGENT</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
any thing else?
Thanks!
Mike
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JBOSS connection pooling