About connection pool - Weblogic

This is a discussion on About connection pool - Weblogic ; Hi Does anyone know how can I get the connection pool in Java? I mean the Java code example. Before I have using weblogic 4.51, when I configure the connection pool in weblogic 4.51, I can use following Java code ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: About connection pool

  1. About connection pool


    Hi
    Does anyone know how can I get the connection pool in Java? I mean the Java
    code example. Before I have using weblogic 4.51, when I configure the connection
    pool in weblogic 4.51, I can use following Java code to get the connection in
    Connection Pool.

    conn = DriverManager.getConnection("jdbc:weblogicool:myconnpool", null, null);

    but now i am going to use the weblogic 8.1, but when I use the same code, I get
    the following error message

    No suitable driver

    Does anyone can help me and provide the Java Code example to me. :>

    Thanks


  2. Re: About connection pool



    1. Configure a connection pool in the admin console.
    2. Configure a tx data source with a jndi binding in the admin console.
    3. Obtain a connection from the datasource.

    Context ctx=null;
    Hashtable ht=new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    ht.put(Context.PROVIDER_URL, "t3://hostnameort");
    ctx = new InitialContext(ht);
    javax.sql.DataSource ds= (javax.sql.DataSource) ctx.lookup ("datasourceJndi");
    java.sql.Connection conn = ds.getConnection();


    "Tommy" wrote:
    >
    >Hi
    > Does anyone know how can I get the connection pool in Java? I mean
    >the Java
    >code example. Before I have using weblogic 4.51, when I configure the
    >connection
    >pool in weblogic 4.51, I can use following Java code to get the connection
    >in
    >Connection Pool.
    >
    > conn = DriverManager.getConnection("jdbc:weblogicool:myconnpool",
    >null, null);
    >
    >but now i am going to use the weblogic 8.1, but when I use the same code,
    >I get
    >the following error message
    >
    > No suitable driver
    >
    >Does anyone can help me and provide the Java Code example to me. :>
    >
    >Thanks
    >



+ Reply to Thread