<JDBCDataSource JNDIName="OraData" Name="OraDataSource"
PoolName="OraPool" Targets="examplesServer"/>
<JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
Name="OraPool" Properties="user=xxx;password=xxx" URL="jdbc:oracle:thin@knoxdb"/>
####<Aug 22, 2001 11:41:08 AM EDT> <Info> <JDBC Pool demoPool> <LEWIS> <examplesServer>
<main> <system> <> <000000> <Cannot set refreshTestMinutes with '0'. Will use
5 minutes.>
####<Aug 22, 2001 11:41:09 AM EDT> <Info> <JDBC Connection Pool> <LEWIS> <examplesServer>
<main> <system> <> <000000> <Connection for pool "demoPool" created.>
####<Aug 22, 2001 11:41:09 AM EDT> <Info> <JDBC Pool demoXAPool> <LEWIS> <examplesServer>
<main> <system> <> <000000> <Cannot set refreshTestMinutes with '0'. Will use
5 minutes.>
####<Aug 22, 2001 11:41:09 AM EDT> <Info> <JDBC Connection Pool> <LEWIS> <examplesServer>
<main> <system> <> <000000> <Connection for XA pool "demoXAPool" created.>
####<Aug 22, 2001 11:41:10 AM EDT> <Info> <JDBC Init> <LEWIS> <examplesServer>
<main> <system> <> <000000> <Creating Data Source named OraData for pool OraPool>
####<Aug 22, 2001 11:41:10 AM EDT> <Info> <JDBC Init> <LEWIS> <examplesServer>
<main> <system> <> <000000> <Creating Data Source named examples-dataSource-demoPool
for pool demoPool>
####<Aug 22, 2001 11:41:10 AM EDT> <Info> <JDBC Init> <LEWIS> <examplesServer>
<main> <system> <> <000000> <Creating TX Data Source named examples-dataSource-demoXAPool
for pool demoXAPool>
Context ctx = null;
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL,
"t3://localhost:7001");
try {
ctx = new InitialContext(ht);
javax.sql.DataSource ds
= (javax.sql.DataSource) ctx.lookup ("oraData");
java.sql.Connection conn = ds.getConnection();
// You can now use the conn object to create
// a Statement object to execute
// SQL statements and process result sets:
Statement stmt = conn.createStatement();
stmt.execute("select * from someTable");
ResultSet rs = stmt.getResultSet();
// Do not forget to close the statement and connection objects
// when you are finished:
stmt.close();
conn.close();
} catch (NamingException e) {
e.printStackTrace();
// a failure occurred
} catch (SQLException e) {
e.printStackTrace();
} finally {
try {ctx.close();}
catch (Exception e) {
// a failure occurred
}
}
When I execute this code it doesn't seem to be able to find the binding to oraData
(but according to the weblogic.log above the binding never happens). How can
I get my binding :) Also, I *do* have my classes12.zip in the classpath.
javax.naming.NameNotFoundException: Unable to resolve oraData. Resolved: '' Unre
solved:'oraData' ; remaining name ''
at weblogic.rmi.internal.AbstractOutboundRequest.sendReceive(AbstractOut
boundRequest.java:90)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:247)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:225)
at weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(ServerNamingNod
e_WLStub.java:121)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at examples.jndi.OracleDataSourceExample.main(OracleDataSourceExample.ja
va:113)
You will have to attach the JDBCOnnection Pool to a Target. In the console
select the pool and select the Targets Tab and associate the pool with a
Target server. Then lookup the datasource.
hth
/
sree
"Steve Lewis" <sle...@cti-pet.com> wrote in message
news:3b8407ae$1...@newsgroups.bea.com...
I'm going to keep looking at it. Thanks for the hints.
Steve
####<Aug 22, 2001 5:45:41 PM EDT> <Info> <JDBC Pool demoXAPool> <LEWIS> <examplesServer>
<main> <system> <> <000000> <Cannot set refreshTestMinutes with '0'. Will use
5 minutes.>
####<Aug 22, 2001 5:45:44 PM EDT> <Info> <JDBC Connection Pool> <LEWIS> <examplesServer>
<main> <system> <> <000000> <Connection for XA pool "demoXAPool" created.>
####<Aug 22, 2001 5:45:44 PM EDT> <Info> <JDBC Pool demoPool> <LEWIS> <examplesServer>
<main> <system> <> <000000> <Cannot set refreshTestMinutes with '0'. Will use
5 minutes.>
####<Aug 22, 2001 5:45:44 PM EDT> <Info> <JDBC Connection Pool> <LEWIS> <examplesServer>
<main> <system> <> <000000> <Connection for pool "demoPool" created.>
####<Aug 22, 2001 5:45:44 PM EDT> <Info> <JDBC Pool OraPool> <LEWIS> <examplesServer>
<main> <system> <> <000000> <Cannot set refreshTestMinutes with '0'. Will use
5 minutes.>
####<Aug 22, 2001 5:45:44 PM EDT> <Info> <JDBC Init> <LEWIS> <examplesServer>
<main> <system> <> <000000> <Creating Data Source named OraData for pool OraPool>
####<Aug 22, 2001 5:45:44 PM EDT> <Info> <JDBC Init> <LEWIS> <examplesServer>
<main> <system> <> <000000> <Creating Data Source named examples-dataSource-demoPool
for pool demoPool>
####<Aug 22, 2001 5:45:44 PM EDT> <Info> <JDBC Init> <LEWIS> <examplesServer>
<main> <system> <> <000000> <Creating TX Data Source named examples-dataSource-demoXAPool
for pool demoXAPool>
let me know if it doesn't work.
/
sree
"Steve Lewis" <sle...@cti-pet.com> wrote in message
news:3b8429b2$1...@newsgroups.bea.com...