The Connection Pool in Weblogic Server

Discussions

Web tier: servlets, JSP, Web frameworks: The Connection Pool in Weblogic Server

  1. The Connection Pool in Weblogic Server (12 messages)

    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 Plus 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.
  2. The Connection Pool in Weblogic Server[ Go to top ]

    weblogic.jdbc.connectionPool.oraclePool=\
           url=jdbc:weblogic:oracle,\
           driver=weblogic.jdbc.oci.Driver,\
           ....
  3. The Connection Pool in Weblogic Server[ Go to top ]

    I think if you set your weblogic.properties this:

           weblogic.jdbc.connectionPool.oraclePool=\
           url=jdbc:weblogic:oracle,\
           driver=weblogic.jdbc.oci.Driver,\
           ....

    you should use oraclePool like below:

        Class.forName("weblogic.jdbc.oci.Driver").newInstance();
        Connection conn = DriverManager.getConnection("jdbc:weblogic:pool:oraclePool");
         ......


    Good luck!
  4. And btw simon your suggestion is not correct
  5. In order to use pool you should use JNDI to get DataSource instance and after that u can get connection.

    Context ctx = ... // create JNDI context
    DataSource ds = (DataSource)(ctx.lookup("OraclePool"));
    Connection conn = nds.getConnection();
  6. The Connection Pool in Weblogic Server[ Go to top ]

    The syntax you used looks fine to me. Did you see the actual pool from the WebLogic Console?
  7. the part in the property file is OK

    but in ur servlet make the follwing changes and see...
    Class.forName("weblogic.jdbc.jts.Driver");
    conn = DriverManager.getConnection("jdbc:weblogic:jts:" + connectionPoolName);

    All the best
  8. It is not working still.
    I am fighting hard, but I am not able to create connection pool betwwen Oracle8 and JSP.
    Please help me.
  9. Here are a few checkpoints:
    o Make sure your environment is set correctly, see http://www.weblogic.com/docs51/classdocs/API_joci.html and http://www.weblogic.com/docs51/install/install_jdbc.html#1062058
    o If the connection pool is configured properly, a message is written to the sever console on startup. If the connection pool fails, an error message is displayed.
    o Test your connection with dbPing, see http://www.weblogic.com/docs51/techstart/dbping.html
    o Consider using the Oracle thin driver. This is a type 4 (pure Java) JDBC driver provided by Oracle.
  10. Seems to me that you need the server and port of your database server. See http://www.weblogic.com/docs51/install/install_jdbc.html#connpool:
       weblogic.jdbc.connectionPool.OraclePool=\
          url=jdbc:weblogic:oracle:myServer:myPort,\
          driver=weblogic.jdbc.oci.Driver,\
          ...

    BTW: Why are you not using the jdbc:oracle:thin driver provided by Oracle?
  11. Suggestion to use DriverManager to obtain connection is not portable across J2EE app servers beacuse it depends on Weblogic JDBC driver.
    Use JNDI to get DataSource and Connection (this way is portable)
  12. The error is :

    java.sql.SQLException: System.loadLibrary threw java.lang.UnsatisfiedLinkError with the message 'no weblogic in java.library.path'

    What might be the reason????
    How to rectify it????
  13. The Connection Pool in Weblogic Server[ Go to top ]

    excuse me!!!!
    Does all this goes with Oracle8i #######