File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes query datasource with jndi Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "query datasource with jndi" Watch "query datasource with jndi" New topic

query datasource with jndi

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi guys,
I hope you can help me. i installed a datasource to a sybase database. When I start the jboss server (v. 3.0.6)I
get the following message:
2003-05-08 10:39:54,861 INFO [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.contentBoxDS] Bound connection factory for resource adapter 'JBoss LocalTransaction JDBC Wrapper' to JNDI name 'java:/contentBoxDS'

When i try now to query this datasource via the following code from a servlet in the same vm:
DataSource ds = null;
Properties p = new Properties();
Context ctx = new InitialContext(p);
ds = (DataSource)ctx.lookup("java:/contentBoxDS");
}catch(Exception e){

i get the message:

javax.naming.NameNotFoundException: contentBoxDS not bound
at org.jnp.server.NamingServer.getBinding(

do you have any idea ?

Thx in advance
I agree. Here's the link:
subject: query datasource with jndi
It's not a secret anymore!