Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

JBOSS connection pooling

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Yeah, but how did the squirrel get in there? Was it because of the tiny ad?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic