Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Oracle JDBC Driver connection pool question

1 view
Skip to first unread message

Steve Lewis

unread,
Aug 22, 2001, 4:27:42 PM8/22/01
to

I have a data source. I have a connection pool. But in the weblogic.log below
the connection pool isn't created. When I try


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

Sree Bodapati

unread,
Aug 22, 2001, 3:38:40 PM8/22/01
to
Hi Steve,

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

Steve Lewis

unread,
Aug 22, 2001, 6:52:50 PM8/22/01
to

Okay thanks. That was obviously wrong, by not having a target. But I'm still
getting the same error. Well, not exactly. It appears to be trying to create
teh connection, but it can't quite do it. I don't get a "created" status for
the oraPool.

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>

Sree Bodapati

unread,
Aug 23, 2001, 8:35:37 AM8/23/01
to
I don't see any error here. Can you please goto the monitor tab when you
select this connection pool in the console and see if there is an entry. If
there is one your pool is created and its datasource is usable.

let me know if it doesn't work.

/
sree

"Steve Lewis" <sle...@cti-pet.com> wrote in message

news:3b8429b2$1...@newsgroups.bea.com...

0 new messages