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

JNDI Problem

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai
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
(key=value)password=password
db=sidname.
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..
Regards,
Megala
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic