posted 21 years ago
Hi.
If you are using a DataSource :
// Obtain a Datasource connection from the WebLogic JNDI tree.
Context ctx = null;
// Put connection properties in to a hashtable.
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);
javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("put here your DataSource JNDI Name");
conn = ds.getConnection();
....
[ December 03, 2002: Message edited by: meital ben ]