Actually the easiest way is to first set up your connection pools within
the weblogic environment.  If you check out the weblogic.properties file in
the root weblogic directory you will find some examples on how to do
this.  This file is where you will set up your Oracle user/password
settings.  This way, Weblogic takes care of database security, connection
pooling, etc.  Once you've done this, it only takes two lines of code (not
counting try and catch statements) to look up the database pool name and
get a connection to it.  You will need to include two Weblogic packages in
your import statements. They are

import weblogic.db.jdbc.*;
import weblogic.html.*;

The code to look up the pool name looks something like this:

   private Connection getConnection() throws SQLException {

         Connection  databaseConnection  =  null ;

                 try {
                         Driver wlDriver = (Driver)
Class.forName("weblogic.jdbc.pool.Driver").newInstance();
                         databaseConnection =
wlDriver.connect("jdbc:weblogic:pool:optiTracPool", null);
                 }
                 catch(Exception e) {
                         e.printStackTrace();
                 }


         return  databaseConnection ;

}

In the second line of code above where you see
jdbc:weblogic:pool:optiTracPool you will need to change optiTracPool to the
name of your database pool in Weblogic.

Thats pretty much it.

If you go to the online documentation for Weblogic and search on connection
pools there is a very good example of this.

Hope this helps!!!

At 15:12 06/10/2000 +0530, you wrote:
>Hi folks,
>
>Let me explain the problem first.
>
>I have installed Weblogic 5.1 on my windowsNT system, I am trying to
>connect the ORACLE database (my db name is WOODLE) which is
>located in ohter sytem ( ip address is 172.16.0.85)..
>
>we are developing application using JDBC thin driver..
>
>Now the question is .
>1. Where should i mention my Database name , UserName, Password, dsn name
>    and Driver info in Weblogic servler..
>
>2. How can i pass init parameters to a servlet.
>
>
>Cheers,
>Sanakr
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff EJB-INTEREST".  For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".

Charles Goff
plaNet Consulting
11225 Davenport
Suite 103
Omaha, NE 68154
================
(402) 330-2999   (Office)
(402) 312-0675   (Mobile)
www.planetci.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to