Win a copy of Learning Java by Building Android Games this week in the Android 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

exception is thrown "mydb is not bound"(needs urgent help)  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We r three students and our final project is a BPM(Business peocess Management)system.

BPM is actually a workflow system(managing the business processes)and all the rules and constraints are applied from the Rule Management System.
we have started the implementation, and therefore we need some help related to the implementation.
We r using EJB2.0 with JBuilder9, JBoss3.2 as the application server and tomcate as the web server.

problem:
I want to create manual database connection using DataSource,
I am using mysql and database name is mydb.
I have done all the reqiured configration of mysql with Joss and it is working.
After getting the initial context, when i try to lookup the datasource, exception is thrown "mydb is not bound"
Initial context is correct because i have tried entity beans asd it works well.
code is
////////////////////////////
Hashtable contextValues = new Hashtable();
contextValues.put(Context.PROVIDER_URL, "jnp://loopback:1099");
contextValues.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
Context context = new InitialContext(contextValues);
context.lookup("java://mydb");

/////////////////////////////

Kindly help me if u find time,

Regards
 
ranger
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adn how did you define your datasource, in the XXX-ds.xml file you can define the JNDI name, and use that name as the lookup.

Mark
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!