• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

JNDI Problem

Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am using weblogic 6.1, i have created the JDBC Connection pools -->
with the following values
Name : conpool
url : jdbc:weblogic racle
Driver Classname : weblogic.jdbc.oci.Driver
Properties user=username
and the same way i have created the JDBC Data Source -->
with the following values
Name: myDataSource
JNDI Name: ------- ?
Pool Name: conpool
with other fields
and JDBC Tx Data Sources -->
Name: conpoolDS
JNDI Name: ------- ?
Pool Name: conpool
and i used to call like the following
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
// Get a context for the JNDI look up
ctx = new InitialContext(ht);
// Context ctx = new InitialContext();
out.println("<p>Connection successful{123}...<p>Executing SQL...<p>");
// Look up myDataSource
javax.sql.DataSource ds
= (javax.sql.DataSource) ctx.lookup ("myDataSource");
//Create a connection object
conn = ds.getConnection();
out.println("<p>Connection successful...<p>Executing SQL...<p>");

// execute some SQL statements to demonstrate the connection.
stmt = conn.createStatement();
the exception on page is -->
Connection error:javax.naming.NameNotFoundException: Unable to resolve myDataSource. Resolved: ''
Unresolved:'myDataSource' ; remaining name ''
My question is in JNDI Name ----- ? what i'll have to fill.(or which) and how to solve this problem?.
thanks in advance..
Beauty is in the eye of the tiny ad.
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic