Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

oracle connection pool

 
Kavita Ghia
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,
I am writing a class which needs frequent connections to the database(oracle8i). i am currently using the bea weblogic server and its connection pool. right now i open separate connections for each instance i dont think thats the right way, so i tried opening a connection in a static initializer which will be there for all the instances, is there any other way by which i can have some common place for managing these connections so that all the instances use the same connection and minimize the time taken.
Thanks,
Kavita
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are really using Weblogic's connection pool, the you don't need to do anything else. When you think you are opening a new connection, you are actually getting one from the pool, so feel free to get one whenever needed, as long as you remember to return it when you have finished. Can you show us a bit of your database access code so we can see if you are really using the pool?
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just went through this on a project. You really have to look at the documentation carefully (we got caught!). We we're using iPlanet with JDBC and realized late in the project that the 'built-in' pooling was actually a collection of Java Connection objects all pointing to the same physical connection. Ultimately, we implemtented Oracle's connection pooling sceme, which you can find here.
http://oradoc.photo.net/ora816/java.816/a81354/connpoc2.htm
Sean
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm transferring this to our new iPlanet forum...
 
Adam Adams
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry to reply to you with a question but if you can take a look at my question and help me out i really appreciate it here we go:
i am trying to run the jdbc/oracle/simpleselect examples.
i folowed all the instruction from: setting the enviornment and build the examples and after i run it i get this error: even thought i have my path sets to in my startup scripts to:
set PATH=.\bin;.\bin\oci817_8;c:\oracle\ora81\bin;%PATH%
here is the error:
C:\bea\wlserver6.1\samples\examples\jdbc\oracle>java examples.jdbc.oracle.simple select
Starting Loading jDriver/Oracle .....
Exception in thread "main" java.sql.SQLException: System.loadLibrary(weblogicoci37) threw java.lang.UnsatisfiedLinkError: no weblogicoci37 in java.library.path at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:226)
at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
at examples.jdbc.oracle.simpleselect.main(simpleselect.java:113)
Originally posted by Kavita Ghia:
Hello friends,
I am writing a class which needs frequent connections to the database(oracle8i). i am currently using the bea weblogic server and its connection pool. right now i open separate connections for each instance i dont think thats the right way, so i tried opening a connection in a static initializer which will be there for all the instances, is there any other way by which i can have some common place for managing these connections so that all the instances use the same connection and minimize the time taken.
Thanks,
Kavita

 
Sanjay Lalwani
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Where can I find Oracle Connection Pooling driver which is suitable to work with Commons DBCP package of Apache?
TIA
Sanjay
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic