Create a javax.sql.DataSource, and lookup this datasource in JNDI, eg:

weblogic.jdbc.connectionPool.oraclePool=\
         url=jdbc:oracle:thin:@200.1.1.1:1521:orard,\
         driver=oracle.jdbc.driver.OracleDriver,\
         initialCapacity=1,\
         loginDelaySecs=1,\
         allowShrinking=true,\
         shrinkPeriodMins=15,\
         maxCapacity=5,\
         capacityIncrement=1,\
         refreshMinutes=10,\
         testTable=dual,\
         props=user=scott;password=tiger

# if you want a jts connection
weblogic.jdbc.TXDataSource.oracle_txds=oraclePool

# if you want a non jts connection
weblogic.jdbc.DataSource.oracle_ds=oraclePool

java code
==========

InitialContext ctx = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource)
ctx.lookup("java:comp/env/jdbc/oracle_txds");

declare it in ejb-jar.xml
=========================

                <resource-ref>
                        <res-ref-name>jdbc/oracle_txds</res-ref-name>
                        <res-type>javax.sql.DataSource</res-type>
                        <res-auth>Container</res-auth>
                </resource-ref>

declare it on weblogic-ejb-jar.xml the real jndi name
=============================================================
        <reference-descriptor>
                <resource-description>
                        <res-ref-name>jdbc/oracle_txds</res-ref-name>
                        <jndi-name>oracle_txds</jndi-name>
                </resource-description>
        </reference-descriptor>


--
  Claudio Miranda
  ___________________________________
  SUN Certified Programmer for JAVA 2


Aravind Ravi wrote:
>
> Hi Vikas, After you made the changes to weblogic.properties file, you should
> have restarted the server, and while doing so did you notice whether the
> oraclePool connection has been successfully created?Check that out. Aravind. EJB
> Vikas wrote:
> Hi Everbody,
> I am using Weblogic with Oracle8i on WindowsNT4.0
> I am connecting to Weblogic via Connection Pooling.
> In my weblogic.properties file I have the following code:
>
> weblogic.jdbc.connectionPool.oraclePool=\
>        url=jdbc:weblogic:oracle,\
>        driver=weblogic.jdbc.oci.Driver,\
>        loginDelaySecs=1,\
>        initialCapacity=4,\
>        maxCapacity=10,\
>        capacityIncrement=2,\
>        allowShrinking=true,\
>        shrinkPeriodMins=15,\
>        refreshMinutes=10,\
>        testTable=dual,\
>        props=user=SCOTT;password=tiger;server=Oracle8
> [I am able to connect to DB by SQL P! lus with given parameters]
>
> But when I write it in My Servlet:
>
> Class.forName("weblogic.jdbc.pool.Driver");
> conn = DriverManager.getConnection"jdbc:weblogic:pool:oraclePool");
>
> I am getting the Error and not able to connect  to the DB.The error raised
> is:
> java.SQL.Exception: Poolconnect failed: Connection Pool oraclePool does not
> exist.
>
> Can anybodyof you tell me that what might be the problem??? How I can rectify
> it????
> TIA.

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