JNDI Problem
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   megala_raghavan
Posted On:   Tuesday, June 3, 2003 10:24 PM

Hai i am using weblogic 6.1, i have created the JDBC Connection pools --> with the following values Name : conpool url : jdbc:weblogic:oracle 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    More>>

Hai


i am using weblogic 6.1, i have created the JDBC Connection pools -->
with the following values


Name : conpool
url : jdbc:weblogic:oracle
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("

Connection successful{123}...

Executing SQL...

");
// Look up myDataSource
javax.sql.DataSource ds
= (javax.sql.DataSource) ctx.lookup ("myDataSource");
//Create a connection object
conn = ds.getConnection();

out.println("

Connection successful...

Executing SQL...

");

// 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

   <<Less

Re: JNDI Problem

Posted By:   Srivatsa_Manjunath  
Posted On:   Tuesday, June 10, 2003 12:00 PM

yes, looks like you are missing an JNDI name for your datasource and connection pool. best way to verify is to use weblogic->console application-> servername node, right click and "view JNDI tree".



Also, make sure you have targetted the connection pool and datasource to the servers as well.

Re: JNDI Problem

Posted By:   Jeyakumar_Raman  
Posted On:   Wednesday, June 4, 2003 11:33 AM

Hi,

Give your JNDI Name as myDataSource and try, it should work.
About | Sitemap | Contact