About connection pooling

hi,
i am trying to achieve connection pooling in Tomcat , can anybody help what is the process ? which one is better either weblogic or tomcat?

This http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html is the official document for Tomcat Connection Pooling.
The instructions for Connection Pooling are different for different versions of Tomcat, so pick the appropriate version and read the document for your version of Tomcat.
Tomcat related questions:
http://tomcat.apache.org/lists.html
JDBC related questions:
http://forum.java.sun.com/forum.jspa?forumID=48

Similar Messages

  • Pls give me a good example about connection pooling

    Hii am new to java, n like to know about connection pooling

    Search this forum or google for connection pooling. You will get plenty

  • Need Help About Connection Pooling

    I am new to WebLogic.
    We have a Java based application hosted on WebLogic 6.1.
    We have not used any Database Pooling utility.
    We are just creating connection objects in JSP/Java files (Worst!!).
    Now we want to use Database Connection Pooling facility of WebLogic.
    So now if I create connection pool from WebLogic console, the database connection pooling will be automatically handle by WebLogic OR I have to develop a class using Database Pooling package of the WebLogic and than need to use that class in all file where I am accessing database.
    Reg,
    Chetan

    Chetan,
    Once you have created a connection pool using the console the next thing to do is create a datasource with a JNDIname that uses that pool.
    Then you can write a ServiceLocator to use JNDI to encapsulate the lookup code and cache the datasource, finally and you can use the datasource to retrieve connections from your connection pool.
    By creating a datasource you decouple your apoplication from connection pools making it more flexible. If you don't like ServiceLocators you can always use something like the spring framework to hide all the plumbing.
    For some example code to connect to a datasource see:
    http://e-docs.bea.com/wls/docs81/jdbc/programming.html#1056955
    For a description of the service locator see:
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/ServiceLocator.html
    And for completeness
    http://www.springframework.org/
    Cheers
    Hussein Badakhchani
    www.orbism.com

  • Can anyone tell me about Connection Pools???

    Hi,
    Is there a freely downloadable Connection Pool implementation available on the net? I need it specifically for Oracle databases... This is for a prod environment and am looking for a stable implementation... Any good information/links is most appreciated.
    Thanks
    Prowzen

    Hi,
    I actually implemented it long time back. This is a best case to implement the Singleton Pattern. Just to give an idea, here is how it goes. I'll try to post the code too but cannot guarantee it right now.
    Basically the Pool information like the database, userid, password, SID etc. should be configurable through a properties file as you are saying that it is a production environment.
    1. Implement your Connection Pool as a Singleton class that has methods like init, getConnection, releaseConnection, createConnection etc. Have private member - a java.util.Vector of java.sql.Connection objects.
    2. Anyone who wants to use the connection pool gets an instance with the getInstance method which will call init method.
    3. The init should read the properties file and get the necessary details. Then create required number of connections and put them in the Vector of connections (pool). You are good to go now. Ideally this should all be done at the startup of the whole Application.
    4. Each client will call the getConnection method of the Singleton. The getConnection should Synchronize the Vector and remove the connection at index 0 of the pool (vector) and return it.
    i.e. public java.sql.Connection getConnection ()
    //wait until someone notifies me after returning a connection back to the pool
    if(connectionPool_.size() == 0)
    wait();
    Connection con = null;
    synchronized(connectionPool_)
    con = (Connection)connectionPool_.elementAt(0);
    connectionPool_.removeElementAt(0);
    return con;
    5. Each client SHOULD call the releaseConnection method of the Singleton once it is done using the connection. The releaseConnection should Synchronize the Vector and add the connection back to the pool.
    So, basically the connections in the pool will be used in a Round-Robin Fashion.
    i.e. public void releaseConnection (java.util.Connection con)
    connectionPool_.addElement(con);
    //Notify all the waiting Clients. Let JVM decide who gets the connection.
    notifyAll();
    return con;
    This is the core logic of what I had written. But there are lot of other cases that you need to consider to write robust code like Lost Connections, when you need to throw that connection away from the pool and add a new one. This is more so significant in busy databases configured to timeout inactive connections. I used to have a low priority thread kicked off at the start along with this main pool that would wake up around 4 or 5 in the night and replenish all the connections in the pool so that it will be good to go for one more day before it gets replenished again. Of course, in such a case, the clients have to have a retry mechanism in case you don't respond in reasonable amount of time while replenishing the connection pool.
    Hope this helps.
    Amar.

  • Query about multiple connection pools under one database

    Hi,
    I have s query about connection pool, now we have a requirement,
    we have two schemas in one db, some data store in one schema, some in another schema,
    all tables are the same, but data is different, we want to retrive all data under two schemas,
    so we need two connection pools under one database,
    I have set two system DSN, and each connection pool was mapping to one DSN,
    but after I importing tables into RPD, when I view data, there is a dialog let me select connection pool. so If this, when we drag columns in answer, it will definitely get wrong.
    so how to realize this function about multiple connection pools under one database and we can get data normally.

    Hi,
    Try this step
    1)Better to create two different DSN for the same database with different user id and password
    2)now create multiple connection pool in the same database in u r RPD physical layer .
    also refer this link : for imporving performance
    http://obiee101.blogspot.com/2009/01/obiee-multiple-connection-pools.html
    http://gerardnico.com/wiki/dat/obiee/connection_pool
    Thanks
    Deva

  • How to use JDBC Connection Pools in a standalone application?

    Hi, there,
    I have a question about how to use JDBC Connection Pools in an application. I know well about connection pool itself, but I am not quite sure how to keep the pool management object alive all the time to avoid being destroyed by garbage collection.
    for example, at the website: http://www.developer.com/java/other/article.php/626291, there is a simple connection pool implementation. there are three classes:JDBCConnection, the application's gateway to the database; JDBCConnectionImpl, the real class/object to provide connection; and JDBCPool, the management class to manage connection pool composed by JDBCConnectionImpl. JDBCPool is designed by Singleton pattern to make sure only one instance. supposing there is only one client to use connection for many times, I guess it's ok because this client first needs instantiate JDBCPool and JDBCConnectionImpl and then will hold the reference to JDBCPool all the time. but how about many clients want to use this JDBCPool? supposing client1 finishes using JDBCPool and quits, then JDBCPool will be destroyed by garbage collection since there is no reference to it, also all the connections of JDBCConnectionImpl in this pool will be destroyed too. that means the next client needs recreate pool and connections! so my question is that if there is a way to keep pool management instance alive all the time to provide connection to any client at any time. I guess maybe I can set the pool management class as daemon thread to solve this problem, but I am not quite sure. besides, there is some other problems about daemon thread, for example, how to make sure there is only one daemon instance? how to quit it gracefully? because once the whole application quits, the daemon thread also quits by force. in that case, all the connections in the pool won't get chance to close.
    I know there is another solution by JNDI if we develop servlet application. Tomcat provides an easy way to setup JNDI database pooling source that is available to JSP and Servlet. but how about a standalone application? I mean there is no JNDI service provider. it seems a good solution to combine Commons DBCP with JNID or Apache's Naming (http://jakarta.apache.org/commons/dbcp/index.html). but still, I don't know how to keep pool management instance alive all the time. once we create a JNDI enviroment or naming, if it will save in the memory automatically all the time? or we must implement it as a daemon thread?
    any hint will be great apprieciated!
    Sam

    To my knoledge the pool management instance stays alive as long as the pool is alive. What you have to figure out is how to keep a reference to it if you need to later access it.

  • BC4J Connection Pooling

    In the BC4J document “About Connection Pooling” it reads, If the connection pool manager can’t create a connection it waits for one (up to the timeout value).
    What happens if the timeout value is exceeded?

    A Exception is thrown.

  • How to use connection pool of datasource to make applications run faster?

    Hi, erveryone
    I prepare to implement a servlet that access database and do sync with client.
    When I access database, I would like to configure a datasource in weblogic and use connection pool.
    In order to make servlet application run significantly faster, my servet how to use connection poo is much moreresonable?
    For example, my servlet has many times database access. Is it true that geting and close a connection whenever
    one time database access finished?
    If from the servlet begins, the db connection is hold till servlet finalize. Will the solution affect the servlet performance? Is there any official document to introduce connection pool program? I search some documents.
    <The Java EE 6Tutorial> introduce some simple intruduction about connection pool.

    1. Use WebLogic Servers Data Source for Database Connections.
    2. Open and close the connections where you need it. Dont open it in begin and close in finalise. That is bad practice.
    3. Even when you invoke Connection.close () webLogic will not close the connection. it will commit the transaction and return it back to the pool rather than physically closing the DB connection.
    4. You can tune data source for minimum, maximum and increments of connections that you need based on your application requirement.

  • Connection/Connection Pooling - Best Practices

    Hi everyone,
    I'm doing my first JDBC application, and I have some questions about the right way to do things. We've got a series of business objects with lots of database abstraction and everything, and the situation comes up where we're making a lot of calls to the database to populate our objects. The high number of calls occur because of the level of abstraction we need, so when we get a Person object, we don't do a join on the address table and the phone table, but instead make seperate calls to those tables. Aside from the fact that this may not be the best way to do things, what is the best way to manage the connections? It's pretty costly time-wise to create a bunch of new connections, so I was just using one connection and passing it through our database call objects, so I'd created a connection to the DB, get my Person information, pass that connection on to read from the Address table, then again to Phone table. I know this can't be good, but it's a lot faster than creating a new connection every time. Also, I don't know how reusing the connection for different things is screwing up the cursor, or causing the application to hang until the connection is free again.
    I've read some stuff about connection pooling with JDBC 2.0, but the need for the JINI calls is confusing to me.
    Can someone take a few minutes to describe the right way to get this to work with Java? I'm using the MSSQL JDBC driver availiable on Microsoft's site, but I didn't notice which version of JDBC it supports. It's Type 4 driver, but I don't know what that means either.
    Thanks in advance,
    Jim

    They're not JINI calls, they're JNDI calls - Java Naming and Directory Interface. They're just doing a lookup to get the data source from the connection pool.
    When you see it done that way, it's usually a container like Tomcat or WebLogic that's handling the connection pool for you. Are you using either of those, or were you going to try to write your own pooling mechanism?
    Type 4 driver means it's 100% pure Java, no native code. You can read all the different types at:
    http://java.sun.com/products/jdbc/driverdesc.html
    There's another driver at SourceForge jTDS for M$ SQL Server that's pretty good. I've used it with some success, switching away from the M$ implementation:
    http://jtds.sourceforge.net/
    Good luck. - MOD

  • Connection Pooling: Do I have to do anything special to use it?

    All,
    I've a question about connection pooling. This is my scenario:
    * Web user makes a request.
    * Request comes to a module (M1).
    * M1 calls my module (M2).
    * M1 and M2 are both java libraries.
    This is what M1 does:
    * It does a JNDI lookup and gets an object (that is basically the handle) to connect to M2.
    * This object has the database connect string attached to it.
    * M1 uses this object and calls, say, a login() method of M2.
    * At this point, M2 connects to a database.
    I use Oracle's thin driver and I've enabled connection caching (which is what it is called in 10g) using DataSource.setConnectionCachingEnabled(true).
    The question I have is -
    1. Does this ensure that I get a connection from the pool everytime? Or, do I need to do something more to enforce that?
    2. I do a
    OracleDataSource ds = new OracleDataSource();each time a connection is requested, but, however, I do this -
    Connection conn = ds.getConnection(); only if (conn == null) || (conn.isClosed) .
    3. Finally, I've a test java application (not a web application) that calls M2. Even if connection pooling were to work above, would it work in this case given that I'm not using any web server (for testing)?
    Thanks for your help.

    Your connection pooling part seems fine to me unless I missed out something.
    One thing I would like to say is that you should close the connection by calling the close() method each time the job is done. Closing the connection does not physically close it. It only sends it back to the connection pool and release the resources held up by that connection.
    In that case, you should not need a check like (conn == null) || (conn.isClosed).
    Finally, even if the application is stand alone, the connection pool can be used as long as the DataSource could be looked up.

  • Rookie Problem:Connection Pool Class not found

    Hi All,
    I'm new to java (3 days now!) and I was writing some sample JSP code to learn about Connection Pooling using Sun Server 8... My goal here is to hopefully learn how to use Connection pooling so I can develop a DAO class that uses good design patterens. It appears that that my J2EE server is not finding my db providers connection pooling class. If this is my problem where should I add this reference? I was looking at the Admin Console and did not see a way to add it there?
    Someone please send me down the right path :)
    I think my error is...."Wrong class name or classpath for Datasource Object : {0}
    java.lang.ClassNotFoundException: com.ibm.db2.jdbc.DB2ConnectionPoolDataSource" (see below for trace)
    Thanks in advance for the help and tips
    John
    My test JSP source code......
    <%/* JMM This page was created on 9/1/2004
    The purpose of this page is to test and learn basic JSP Connection Snytax and flow
    control */%>
    <%/* **********Begin JSP Page Directives********** */%>
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page import="javax.sql.*"%>
    <%@page import="java.sql.*"%>
    <%@page import="javax.naming.*"%>
    <%@page import="java.util.Hashtable"%>
    <%/* ********** End JSP Page Directive ********** */%>
    <%! String pageName = "Johns Test JSP Page";
    String jndi_ereporting_nm = "jdbc/F0654TE1";
    %>
    <html>
    <head><title><%=pageName%></title></head>
    <body>
    <%-- <jsp:useBean id="beanInstanceName" scope="session" class="beanPackage.BeanClassName" /> --%>
    <%-- <jsp:getProperty name="beanInstanceName" property="propertyName" /> --%>
    Importing the follwoing Libs<br>
    <br>import javax.sql.*;
    <br>import java.sql.*;
    <br>import javax.naming.*;
    <br>import java.util.Hashtable;
    <br>
    <br>Attempting to connnect to F0654TE1 using JNDI Lookup....
    <br>
    <%
              DataSource ds = null;
              Connection con = null;
              Context ctx = null;
              Hashtable env = null;
              long nStartTime, nStopTime, nElapsedTime;
              // Set up environment for creating InitialContext object
              //humm.. whats stored in here ....what are these used for?
    out.println("Context.INITIAL_CONTEXT_FACTORY=" + Context.INITIAL_CONTEXT_FACTORY + "<br>");
              out.println("Context.PROVIDER_URL=" + Context.PROVIDER_URL + "<br>");
              InitialContext ic = new InitialContext();
              ds = (DataSource) ic.lookup(jndi_ereporting_nm);
         out.println("open connection....<br>");
              con = ds.getConnection();
         out.println("connection has been opened!!!....<br>");
              con.close();
         out.println("connection has been closed!!!....<br>");     
    %>
    <br>
    <br>Finished attempting to connnect to F0654TE1 using JNDI....
    </body>
    </html>
    Errror Log file.....
    [#|2004-09-02T10:08:42.951-0400|SEVERE|sun-appserver-pe8.0.0_01|javax.enterprise.resource.resourceadapter|_ThreadID=11;|RAR5099 : Wrong class name or classpath for Datasource Object : {0}
    java.lang.ClassNotFoundException: com.ibm.db2.jdbc.DB2ConnectionPoolDataSource
         at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:141)
         at com.sun.gjc.common.DataSourceObjectBuilder.getDataSourceObject(DataSourceObjectBuilder.java:198)
         at com.sun.gjc.common.DataSourceObjectBuilder.constructDataSourceObject(DataSourceObjectBuilder.java:65)
         at com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManagedConnectionFactory.java:70)
         at com.sun.enterprise.resource.LocalTxConnectorAllocator.createResource(LocalTxConnectorAllocator.java:63)
         at com.sun.enterprise.resource.IASNonSharedResourcePool.createSteadyResources(IASNonSharedResourcePool.java:501)
         at com.sun.enterprise.resource.IASNonSharedResourcePool.initPool(IASNonSharedResourcePool.java:176)
         at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource(IASNonSharedResourcePool.java:314)
         at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASNonSharedResourcePool.java:260)
         at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:244)
         at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:137)
         at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:194)
         at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:94)
         at com.sun.gjc.spi.DataSource.getConnection(DataSource.java:68)
         at org.apache.jsp.jsp.jndi_005fdb_005ftest_jsp._jspService(jndi_005fdb_005ftest_jsp.java:102)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:102)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:282)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:263)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:210)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:246)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:268)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:236)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:141)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:214)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:168)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:133)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:539)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:134)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:254)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:114)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingValve.java:166)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:165)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:683)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:604)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:542)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:647)
         at java.lang.Thread.run(Thread.java:534)
    |#]
    [#|2004-09-02T10:08:42.961-0400|WARNING|sun-appserver-pe8.0.0_01|javax.enterprise.resource.resourceadapter|_ThreadID=11;|RAR5038:Unexpected exception while creating resource|#]
    [#|2004-09-02T10:08:42.961-0400|WARNING|sun-appserver-pe8.0.0_01|javax.enterprise.resource.resourceadapter|_ThreadID=11;|RAR5117 : Failed to obtain/create connection. Reason : Class name is wrong or classpath is not set for : com.ibm.db2.jdbc.DB2ConnectionPoolDataSource|#]
    [#|2004-09-02T10:08:42.961-0400|WARNING|sun-appserver-pe8.0.0_01|javax.enterprise.resource.resourceadapter|_ThreadID=11;|RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : com.ibm.db2.jdbc.DB2ConnectionPoolDataSource]|#]
    [#|2004-09-02T10:08:43.131-0400|SEVERE|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=11;|StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
    java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : com.ibm.db2.jdbc.DB2ConnectionPoolDataSource
         at com.sun.gjc.spi.DataSource.getConnection(DataSource.java:72)
         at org.apache.jsp.jsp.jndi_005fdb_005ftest_jsp._jspService(jndi_005fdb_005ftest_jsp.java:102)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:102)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:282)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:263)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:210)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:246)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:268)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:236)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:141)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:214)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:168)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:133)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:539)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:134)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:254)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:114)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingValve.java:166)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:165)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:683)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:604)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:542)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:647)
         at java.lang.Thread.run(Thread.java:534)
    |#]

    Sorry this is not the way i usually handle db connectivity, i think you need to set up a name in your server.xml file (this is for tomcat based applicatin servers) which is then referenced in your jsp file. I have had a quick google and found this.
    http://manual.evolutionhosting.com/evochunk/ch19s04.html
    You menttioned that you wanted to devolp really good design patterns, how big is your project going to be, if it is going to be a large project then you may want to look at
    http://www.hibernate.org

  • Help needed for Connection Pooling

    I want to know about connection pooling in java.Can anyone suggest a best tutorial or link to learn this.

    http://java.sun.com/developer/onlineTraining/Programming/JDCBook/conpool.html
    http://java.sun.com/products/jndi/tutorial/ldap/connect/pool.html
    or better Google it.

  • Connection pooling - where to start

    I'm starting to learn about connection pooling but I am unsure of how it can be used to in the web server environment. Are connection pools just static classes placed in a global environment for all webapps to use? What is the best approach for creating these pools. How would an app access this class? Thanks!

    Where to start with connection pooling?
    The shallow end, of course. And don't go in within 30 minutes of eating.
    The best approach is to let your app server handle it for your. Tomcat does; so does WebLogic and every other J2EE-compliant container.
    When the container handles it, classes will do a JNDI lookup of the connection and go from there.
    Check out the docs for details on how to set it up.

  • Connection Pooling: how many active connections?

    Hi, everybody.
    I have a very simple question about connection pooling...
    How many active connections should a database see once a connection pool has been opened?
    I mean, it should see only one connection (the pool itself) at any time, or the number of "logical" active connections in that moment?
    Thanks for any answer.

    Sorry...
    This is the wrong forum, I posted again my question in the JDBC Forum...

  • Connection pooling with mysql!!

    Hi,
    I've been reading about connection pooling for days. I want to use it with mysql. I believe that the vendor usually supplies implementations for the javax.sql.PooledConnection and javax.sql.ConnectionPoolDataSource, but I can't find this on the mysql site or any forums.
    PoolMan from www.codestudio.com was suggested but that doesn't seem to exist anymore.
    I really don't want to build my own from scratch. Does anyone have any suggestions????
    Thanks in advance,
    Louise.

    >
    PoolMan from www.codestudio.com was suggested but that
    doesn't seem to exist anymore.
    What about this
    http://sourceforge.net/projects/poolman

Maybe you are looking for