I am a little confused by your question but I will tell you what we have
been doing
In our EJB's and Beans we use the following code to connect to the database.
Once we connect and retrieve all the necessary data we close the connection.
I am using Weblogic Type II Oracle Driver.
This code should be in your weblogic.properties file
weblogic.jdbc.connectionPool.atlasPool=\
url=jdbc:weblogic:oracle,\
driver=weblogic.jdbc.oci.Driver,\
initialCapacity=1,\
maxCapacity=2,\
capacityIncrement=1,\
props=user=XXXXX;password=XXXXX;server=XXXXXX
weblogic.allow.reserve.weblogic.jdbc.connectionPool.atlasPool=atlas
the following code should be in your jsp, ejb or Beans or servelts
Properties props = new Properties();
props.put("user","####");
props.put("password","#####");
Driver myDriver =
(Driver)Class.forName("weblogic.jdbc.pool.Driver").newInstance();
Connection conn = myDriver.connect("jdbc:weblogic:pool:atlasPool", props);
sql = "Select * from dual
QueryDataSet qds=new QueryDataSet(conn, sql);
ResultSet rs = qds.getResultSet();
Daniel Jaffa
-----Original Message-----
From: Rupali Bains Goswami [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 30, 2000 8:54 AM
To: [EMAIL PROTECTED]
Subject: Connection Pool
I Have a very basic question.
I am using weblogic and have created the connection pool in the properties
file.
How do i then connect to the database? should i have an init method for the
initial connection?
All I want to do is initially connect to the database and query some tables
the code is something like this
Class.forName (jdbcClass).newInstance();
Connection conn = DriverManager.getConnection(jdbcURL,user,password);
how would i then maintain the connection through all my jsp pages.
Thanks for all the help.
-Nisha
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets