my dog learned polymorphism*
The moose likes BEA/Weblogic and the fly likes Connection Pool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Connection Pool" Watch "Connection Pool" New topic
Author

Connection Pool

Reeti Saha
Ranch Hand

Joined: Jun 26, 2001
Posts: 34
Hi:
I'm trying to create connection pool to a oracle database using thin driver. After creating it when I start my server it doesn't give me any error. While I'm trying to check the pool using
java weblogic.Admin -url localhost:7001 -user
name system -password system123 EXISTS_POOL OraclePool
then it is saying OraclePool doesn't exist.
Can anyone will let me know how to create the Connection pool with an example.
Thanks and Regards
Reeti
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Hi,
You problably forgot to target the pool to your server, after you have created the pool you have to use the target tab on the admin console and choose the target server for that pool.
hope this helps.
Reeti Saha
Ranch Hand

Joined: Jun 26, 2001
Posts: 34
Hi:
Thanks a lot. I forgot to set the target name, now when I've set it then while starting the server it is giving lots of error. Some TNS resolution problem. Can u pls. give me an example of Driver Class name and other properties of the connection pool.
Thanks and Regards
Reeti
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Hi,
I think that the best way to check the connection is using a tool called utils.dbping that ships with weblogic, to do that open a console window and navigate to:
%WL_HOME%\config\%DOMAIN_NAME% and run the script setEnv , than you can use this notation:
Usage: java utils.dbping ORACLE USER PASS DBNAME
or java utils.dbping ORACLE_THIN USER PASS HOST:PORTBNAME
or java utils.dbping JCONNECT USER PASS HOST:PORT/DBNAME
or java utils.dbping INFORMIX4 USER PASS DBNAME@HOST:PORT
or java utils.dbping MSSQLSERVER4 USER PASS DBNAME@HOST:PORT

if everithing goes well it�s gonna show you the notation you can use to configure access the DB you choose.
regards.
[ March 07, 2002: Message edited by: Marcos Maia ]
Reeti Saha
Ranch Hand

Joined: Jun 26, 2001
Posts: 34
Hi:
Thanks for the help. Now it seems the connection pool is working but i've got some other problem. While I created the connection pool I also created a datasource and gave the JNDI name "JDBCOracle". This JNDI name I've used in the "weblogic-ejb-jar.xml" resource description section. While I'm trying to get the connection from the pool in my EJB then I've written:
icon = new InitialContext();
dSource = (javax.sql.DataSource) icon.lookup("java:comp/env/jdbc/JDBCOracle");
dSource.getConnection();
This is giving me exception:
javax.naming.NameNotFoundException: Unable to resolve comp/env/jdbc/JDBCOracle/ Resolved: 'comp/env/jdbc' Unresolved:'JDBCOracle' ; remaining
name ''
Can anyone help me?
Regards
Reeti
gautam shah
Ranch Hand

Joined: Oct 29, 2000
Posts: 72
Originally posted by Reeti Saha:
Hi:
Thanks for the help. Now it seems the connection pool is working but i've got some other problem. While I created the connection pool I also created a datasource and gave the JNDI name "JDBCOracle". This JNDI name I've used in the "weblogic-ejb-jar.xml" resource description section. While I'm trying to get the connection from the pool in my EJB then I've written:
icon = new InitialContext();
dSource = (javax.sql.DataSource) icon.lookup("java:comp/env/jdbc/JDBCOracle");
dSource.getConnection();
This is giving me exception:
javax.naming.NameNotFoundException: Unable to resolve comp/env/jdbc/JDBCOracle/ Resolved: 'comp/env/jdbc' Unresolved:'JDBCOracle' ; remaining
name ''
Can anyone help me?
Regards
Reeti

I think one of the two, given below must work properly.
icon = new InitialContext();
dSource = (javax.sql.DataSource) icon.lookup("JDBCOracle");
dSource.getConnection();

||

icon = new InitialContext();
dSource = (javax.sql.DataSource) icon.lookup("/jdbc/JDBCOracle");
dSource.getConnection();

try.... it!
gautam shah
Ranch Hand

Joined: Oct 29, 2000
Posts: 72
and also check log file to check whether that connection pool is being created or not at the time of server startup???
peter brews
Ranch Hand

Joined: Jan 25, 2002
Posts: 59
Reeti,
Could you please let me know all the steps that needs to done to create a connection pool using Oracle thin driver in weblogc 6.1.

Thanks,
smita
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Connection Pool
 
Similar Threads
Standalone Connection pooling with DBCP
increase database connection
ConnectionPool problem
DB2 Setup in Weblogic5.1/6.1
Connection Pool