Connection Pool with MySQL

Can anyone tell me all necessary steps required to create a connection pool to
MySQL and use the datasource to get the connection in BMP beans
Thanks in advance
Thara

Using weblogic's mssql driver:
define following configuration in your config.xml.
<JDBCConnectionPool
Name="MSSQLPool"
Targets="myserver"
URL="jdbc:weblogic:mssqlserver4"
DriverName="weblogic.jdbc.mssqlserver4.Driver"
InitialCapacity="0"
MaxCapacity="20"
CapacityIncrement="1"
Properties="user=jmsqa;password=jmsqa123;server=lcdbnt4"
/>
<JDBCDataSource
Name="jdbc.pool.testpool"
Targets="myserver"
JNDIName="jdbc.pool.testpool"
PoolName="testpool"
/>
Also, do following to make sure your environment is set.
java utils.dbping MSSQLSERVER4 USER PASS DBNAME@HOST:PORT
Thara wrote:
Can anyone tell me all necessary steps required to create a connection pool to
MySQL and use the datasource to get the connection in BMP beans
Thanks in advance
Thara

Similar Messages

  • Help Please: How to make a connection pool with mySQL

    Hi,
    I am learning the example codes shipped with weblogic server, which is under ...samples\examples\ejb20\basic\beanManaged. The original connection pool was on cloudscape. I was trying to modify it and make it connect to mySQL.
    In ejb-jar.xml and weblogic-ejb-jar.xml, I replaced "demopool" (which was the original pool name) with "demopool1".
    After starting the server, I tried to configure a new connection pool as following:
    Name: demopool1
    URL: jdbc:mysql:///test
    Driver Classname: org.gjt.mm.mysql.Driver
    Properties
    (key=value): user=none
    server=none
    But I got the following errors:
    <2007-10-5 ??06?30?09?> <Error> <JDBC> <Cannot startup connection pool "demopool1" Cannot load driver class: org.gjt.mm.mysql.Driver>
    What should I do to let the server find the Driver?
    Thanks a lot.

    Hong Qu wrote:
    Thank you Joe,
    I added the jar file location to the startExampleServer script. But when I tried to configure the Tx Data Sources from the console, I got the following error:
    <2007-10-5 ??08?35?17?> <Notice> <WebLogicServer> <Started WebLogic Admin Server "examplesServer" for domain "examples" running in Development Mode>
    setEntityContext called
    ejbFindByPrimaryKey (ID: 0)
    Failed to lookup JDBC Datasource. Please double check that
    the JNDI name defined in the resource-description of the
    EJB's weblogic-ejb-jar.xml file is the same as the JNDI name
    for the Datasource defined in your config.xml.
    <2007-10-5 ??08?38?16?> <Error> <JDBC> <Error during Data Source creation:
    weblogic.common.ResourceException: DataSource(examples-dataSource-demoPool1)
    can't be created with non-existent Pool (connection or multi) (demoPool1)>>
    Do you know where is wrong?
    Another problem is the connection method in AccountBean.java:
    private Connection getConnection()
    throws SQLException
    InitialContext initCtx = null;
    try {
    initCtx = new InitialContext();
    DataSource ds = (javax.sql.DataSource)
    initCtx.lookup("java:comp/env/jdbc/demoPool");First verify from the console that a pool 'demoPool1' exists and
    that you can test it from the console. Then find the DataSource
    you associated with that pool. For an EJB I would suggest a
    TxDataSource. You defined some JNDI name for the DataSource. Use
    that name in the lookup. For instance, if your DataSource's
    JNDI name is 'MyDataSource', the code should do this:
    DataSource ds = (javax.sql.DataSource)
    initCtx.lookup("MyDataSource");
    return ds.getConnection();
    } catch(NamingException ne) {
    log("Failed to lookup JDBC Datasource. Please double check that");
    log("the JNDI name defined in the resource-description of the ");
    log("EJB's weblogic-ejb-jar.xml file is the same as the JNDI name ");
    log("for the Datasource defined in your config.xml.");
    throw new EJBException(ne);
    } finally {
    try {
    if(initCtx != null) initCtx.close();
    } catch(NamingException ne) {
    log("Error closing context: " + ne);
    throw new EJBException(ne);
    I couldn't figure out what "java:comp/env/jdbc/demoPool" was related, so I just replaced "demopool" with "demopool1". Do you konw what "comp/env/jdbc" mean? Is it a location?
    Thank you so much.
    Iris

  • 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

  • Configuring JCo3 Connection Pool with single sign on on non SAP Java server

    Hi Everyone,
    i have configured a connection pool on JBoss as per JCo3 Documentation and is working great.
    Now I need help to configure this connection pool with single sign on so that RFc on SAP ECC systems are executed using end users credential rather than using single user name password used to configure JCo connection pool.
    On SAP Java stack I am sure its possible within Java WebDynpro    and i assume using JCA resource adapter. But what if we don't want to use SAP Java App server.
    Any help will be appreciated.
    Thanks,
    Divyakumar Jain

    Eason, 你好!
    I have exactly the same problem.  Did you find a solution to this problem?  If so, please let me know!

  • Connection pooling with SQL Server 2008 and Tomcat 6.0

    Hello Everybody,
    I'm creating a web application using struts 2.0 , tomcat 6.0 and sql server 2008.
    Everything works fine but i'm unable to create connection pooling with sql server 2008.Please help me to solve this issue.
    Code for this is as foolows:
    in my META-INF/context.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/spas" docBase="spas"
    debug="5" reloadable="true" crossContext="true">
    <Resource
    name="jdbc/spas_new"
    auth="Container"
    type="javax.sql.DataSource"
    maxActive="20"
    maxIdle="10"
    maxWait="-1"
    user="spas_user"
    password="spas123"
    driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
    url="jdbc:sqlserver://HGL-0053\dbo:1433;databaseName=spas_new;responseBuffering=adaptive;"/>
    </Context>
    in my web.xml
    <resource-ref>
    <description>SQL Server Datasource</description>
    <res-ref-name>jdbc/spas_new</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    and in my ConnectionThread.java file i've used:
    Context ctx = new InitialContext();
    if(ctx == null )
    throw new Exception("Sorry! No Context Exception");
    DataSource ds = (DataSource)ctx.lookup("java:/comp/env/jdbc/spas_new");
    System.out.println("ds:"+ds);
    conn=ds.getConnection();
    Following is the exception:
    org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Login failed for user ''.)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
    at login.V_SPAS_ConnectionThread.getConnection(V_SPAS_ConnectionThread.java:87)
    at org.apache.jsp.login.v_005fspas_005flogin_005fpage_jsp._jspService(v_005fspas_005flogin_005fpage_jsp.java:95)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
    at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
    at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1023)
    at org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:345)
    at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:572)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:221)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:694)
    at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:665)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:54)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at login.V_SPAS_SecurityCheckFilter.doFilter(V_SPAS_SecurityCheckFilter.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user ''.

    Hi Karthikeyan,
    This is not the issue at all. I can open the management studio by the same login id and password and also i can make the database jdbc connection from plain java file.
    It does not give me any problem by them.
    I'm unable to find the actual problem. May be i'm missing something in connection pooling.
    Please help.
    Regards
    Mina

  • Can' t connect Java with MySQL

    My goal is to connect Java with MySQL. I found many solutions on Internet, but I always get the same mistake:
    SQLException: No suitable driver
    SQLState: 08001
    VendorError: 0MySQL works fine alone or with php.Only thing left me to think is that the installed versions are not compatible for this mysql-connector-java-5.0.4
    I don't believe that could be a reason.
    Installed versions are:
    Apache Tomcat 5.5.20 Server
    Apache HTTP Server 2.2.4
    PHP 5.2.0
    MySQL 5.2
    jre 1.5.0_11
    jdk1.5.0_11
    Apache Tomacat JK2 connector Version: 1.2.20 File Name: mod_jk-apache-2.2.3.so
    mysql-connector-java-5.0.4
    I also set connector in class path: C:\mysql-connector-java-5.0.4;C:\mysql-connector-java-5.0.4\mysql-connector-java-5.0.4-bin.jar;C:\mysql-connector-java-5.0.4\src\com\mysql\jdbc
    For installation I used manulas from:
    http://apacheguide.org/jsp.php
    http://doc.51windows.net/mysql/?url=/MySQL/ch23s03.html
    Here is also a test code in java:
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
       public class Connect
           public static void main (String[] args)
               Connection conn = null;
               try {
        conn =
           DriverManager.getConnection("jdbc:mysql://localhost/first_test" +
                                       "user=monty&password=greatsqldb");
        // Do something with the Connection
    } catch (SQLException ex) {
        // handle any errors
        System.out.println("SQLException: " + ex.getMessage());
        System.out.println("SQLState: " + ex.getSQLState());
        System.out.println("VendorError: " + ex.getErrorCode());
       }i'm desperate, please help or tell me someone who'll know the answer.
    Thank You in advance

    hey buddy .. it seems yr code is wrong .. in getconnection () method u should also specify the port ,which u r not doing ...
    the default port for MySQL is 3306 ... see below i am giving you a sample code ... its working fine .. and dont forget to put the MySQL driver jar path in to classpath and also copy the jar into common/lib folder of your tomcat ....
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    public class MySQLConnectionTest {
         public static void main(String[] args) {
    new MySQLConnectionTest().connTest();
    public void connTest() {
              String tableName = "portfolio"; //change as per setting
              String hostName = "10.81.9.39"; // please change for the target database ip or hostname
              String dbPort = "3306"; //change if not using the default
              String dbName = "tradingsystem"; //change as per the given DB name
              String username = "root"; //change as per setting
              String password = "password"; //change as per setting
              System.out.println("before try");
              Double data=0.0;
         Double data1=0.0;
              try {
    Class.forName("org.gjt.mm.mysql.Driver");
                   System.out.println("before driver manager");
    Connection conn = DriverManager.getConnection("jdbc:mysql://"+hostName+":"+dbPort+"/"+dbName, username, password);
    String query1 = "select * from "+tableName+" where User_id='trader1' and Stock_Type='Equity'";
    System.out.println("quesry1="+query1);
    Statement stmt = conn.createStatement();
    ResultSet rs1 = stmt.executeQuery(query1);
    while(rs1.next())
         System.out.println("hiiiiii for rs1");
         System.out.println(rs1);
         Quantity=(Integer)rs1.getObject(5);
         MarketPrice=(Double) rs1.getObject(8);
         data=Quantity*MarketPrice;
         data1+=data;
         System.out.println("data1="+data1);
         i=0;
    rs1.close();
    stmt.close();
    conn.close();
    } catch (ClassNotFoundException e) {
    e.printStackTrace(System.err);
    } catch (SQLException e) {
    e.printStackTrace(System.err);
    i hope it will work for u...
    cheers,

  • How to connect APEX with MYSQL via Apex's Database link

    How do i connect APEX with MYSQL via Apex's Database link? The OBE doesn't go into specific detail about how to link the two.
    can someone please elaborate on what these are and where i can find them in mysql:
    Database Link Name      
    Connect To Schema      
    Password      
    Remote Hostname or IP      
    Remote Host Port      
    SID or Service Name      
    I need to link to mysql database so I can set up a 3D pie chart in apex

    Hi jononioo
    A database link is a device for connecting between Oracle database instances only. Oracle does have a method for connecting to other database systems (Transparent Gateway) but this is restricted to other commercial databases and I don't believe there is a gateway for Mysql. (I could be wrong)
    I don't know Mysql but maybe there is some way to push data to the Oracle instance. Other than that, is there any reason why the data has to reside in the Mysql database?
    Regards
    Andre

  • Connection Pool with Variables

    Hi i am a newbie to Obiee and i want to know how to import tables into a connection pool with variables in place of Data Source Name: valueof(DSN_DM) username:value of(DSN_DM_USER)
    like that i want to import my new tables into this connection pool how i can do that. i tried importing but it is coming as a new subject area.
    Can any Body help me
    Thanks

    Hi copter,
    Firstly you imported some tables and again as adding tables your are using variable in connection pool and importing tables then it takes as a new subject area only.....Instead use this variable connection pool to import all tables from scratch and then work on it.This would do.
    Either if it is a seperate subject area pull the columns needed from both the subject areas and work on it.Before doing that you need to establish joins between the subject area tables.
    http://forums.oracle.com/forums/thread.jspa?threadID=1123247&tstart=-1
    hope helps you.
    Cheers,
    KK

  • Strange behaviour when using connection pooling with proxy authentication

    All
    I have developed an ASP.NET 1.1 Web application that uses ODP.NET 9.2.0.4 accessing Oracle Database 8i (which is to be upgraded to 10g in the coming months). I have enabled connection pooling and implemented proxy authentication.
    I am observing a strange behaviour in the live environment. If two users (User 1 and User 2) are executing SQL statements at the same time (concurrent threads in IIS), the following is occurring:
    * User 1 opens a new connection, executes a SELECT statement, and closes this connection. The audit log, which uses the USER function, shows User 1 executed this statement.
    * User 2 opens the same connection (before it is released to the connection pool?), excutes an INSERT statement, and closes this connection. The audit log shows User 1, not User 2, executed this statement.
    Is this a known issue when using connection pooling with proxy authentication? I appreciate your help.
    Regards,
    Chris

    Hi Chris,
    I tried to reproduce your complaint, but was unable to. I didnt use auditting however, just a series of "select user from dual" with proxy authentication. You might want to see if you can put together a small complete testcase for this and open a sr with support.
    Cheers
    Greg

  • Has anyone run the connection pooling for mysql & tomcat successfully?

    I'm trying to set up connection pooling. I'm following the how-to page at
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
    But when i test the DBTest/test.jsp file, tomcat displays an error =
    could not load jdbc driver class 'null'(msdos)
    i have placed all the required .jar files in the tomcat lib.
    below is the cofiguration i did to the server.xml file
    <!-- Example Server Configuration File -->
    <!-- Note that component elements are nested corresponding to their
    parent-child relationships with each other -->
    <!-- A "Server" is a singleton element that represents the entire JVM,
    which may contain one or more "Service" instances. The Server
    listens for a shutdown command on the indicated port.
    Note: A "Server" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <Server port="8005" shutdown="SHUTDOWN" debug="0">
    <!-- Uncomment these entries to enable JMX MBeans support -->
    <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
    debug="0"/>
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
    debug="0"/>
    <!-- Global JNDI resources -->
    <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <!-- Editable user database that can also be used by
    UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="UserDatabase">
    <parameter>
    <name>factory</name>
    <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
    </parameter>
    <parameter>
    <name>pathname</name>
    <value>conf/tomcat-users.xml</value>
    </parameter>
    </ResourceParams>
    </GlobalNamingResources>
    <!-- A "Service" is a collection of one or more "Connectors" that share
    a single "Container" (and therefore the web applications visible
    within that Container). Normally, that Container is an "Engine",
    but this is not required.
    Note: A "Service" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <!-- Define the Tomcat Stand-Alone Service -->
    <Service name="Tomcat-Standalone">
    <!-- A "Connector" represents an endpoint by which requests are received
    and responses are returned. Each Connector passes requests on to the
    associated "Container" (normally an Engine) for processing.
    By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
    You can also enable an SSL HTTP/1.1 Connector on port 8443 by
    following the instructions below and uncommenting the second Connector
    entry. SSL support requires the following steps (see the SSL Config
    HOWTO in the Tomcat 4.0 documentation bundle for more detailed
    instructions):
    * Download and install JSSE 1.0.2 or later, and put the JAR files
    into "$JAVA_HOME/jre/lib/ext".
    * Execute:
    %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
    $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
    with a password value of "changeit" for both the certificate and
    the keystore itself.
    By default, DNS lookups are enabled when a web application calls
    request.getRemoteHost(). This can have an adverse impact on
    performance, so you can disable it by setting the
    "enableLookups" attribute to "false". When DNS lookups are disabled,
    request.getRemoteHost() will return the String version of the
    IP address of the remote client.
    -->
    <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8081 -->
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
    port="8080" minProcessors="5" maxProcessors="75"
    enableLookups="true" redirectPort="8443"
    acceptCount="100" debug="0" connectionTimeout="20000"
    useURIValidationHack="false" disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value
    to -1 -->
    <!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
    <!--
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
    port="8443" minProcessors="5" maxProcessors="75"
    enableLookups="true"
         acceptCount="100" debug="0" scheme="https" secure="true"
    useURIValidationHack="false" disableUploadTimeout="true">
    <Factory className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
    clientAuth="false" protocol="TLS" />
    </Connector>
    -->
    <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
    port="8009" minProcessors="5" maxProcessors="75"
    enableLookups="true" redirectPort="8443"
    acceptCount="10" debug="0" connectionTimeout="20000"
    useURIValidationHack="false"
    protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <!--
    <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
    port="8009" minProcessors="5" maxProcessors="75"
    acceptCount="10" debug="0"/>
    -->
    <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
    <!-- See proxy documentation for more information about using this. -->
    <!--
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
    port="8082" minProcessors="5" maxProcessors="75"
    enableLookups="true" disableUploadTimeout="true"
    acceptCount="100" debug="0" connectionTimeout="20000"
    proxyPort="80" useURIValidationHack="false" />
    -->
    <!-- Define a non-SSL legacy HTTP/1.1 Test Connector on port 8083 -->
    <!--
    <Connector className="org.apache.catalina.connector.http.HttpConnector"
    port="8083" minProcessors="5" maxProcessors="75"
    enableLookups="true" redirectPort="8443"
    acceptCount="10" debug="0" />
    -->
    <!-- Define a non-SSL HTTP/1.0 Test Connector on port 8084 -->
    <!--
    <Connector className="org.apache.catalina.connector.http10.HttpConnector"
    port="8084" minProcessors="5" maxProcessors="75"
    enableLookups="true" redirectPort="8443"
    acceptCount="10" debug="0" />
    -->
    <!-- An Engine represents the entry point (within Catalina) that processes
    every request. The Engine implementation for Tomcat stand alone
    analyzes the HTTP headers included with the request, and passes them
    on to the appropriate Host (virtual host). -->
    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Standalone" defaultHost="localhost" debug="0">
    <!-- The request dumper valve dumps useful debugging information about
    the request headers and cookies that were received, and the response
    headers and cookies that were sent, for all requests received by
    this instance of Tomcat. If you care only about requests to a
    particular virtual host, or a particular application, nest this
    element inside the corresponding <Host> or <Context> entry instead.
    For a similar mechanism that is portable to all Servlet 2.3
    containers, check out the "RequestDumperFilter" Filter in the
    example application (the source for this filter may be found in
    "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
    Request dumping is disabled by default. Uncomment the following
    element to enable it. -->
    <!--
    <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
    -->
    <!-- Global logger unless overridden at lower levels -->
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="catalina_log." suffix=".txt"
    timestamp="true"/>
    <!-- Because this Realm is here, an instance will be shared globally -->
    <!-- This Realm uses the UserDatabase configured in the global JNDI
    resources under the key "UserDatabase". Any edits
    that are performed against this UserDatabase are immediately
    available for use by the Realm. -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
    debug="0" resourceName="UserDatabase"/>
    <!-- Comment out the old realm but leave here for now in case we
    need to go back quickly -->
    <!--
    <Realm className="org.apache.catalina.realm.MemoryRealm" />
    -->
    <!-- Replace the above Realm with one of the following to get a Realm
    stored in a database and accessed via JDBC -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
    driverName="org.gjt.mm.mysql.Driver"
    connectionURL="jdbc:mysql://localhost/authority"
    connectionName="test" connectionPassword="test"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
    driverName="oracle.jdbc.driver.OracleDriver"
    connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
    connectionName="scott" connectionPassword="tiger"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
    driverName="sun.jdbc.odbc.JdbcOdbcDriver"
    connectionURL="jdbc:odbc:CATALINA"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!-- Define the default virtual host -->
    <Host name="localhost" debug="0" appBase="webapps"
    unpackWARs="true" autoDeploy="true">
    <Context path="/my-jsp" docBase="c:\JSP-Files" debug="0"
    privileged="true" reloadable="true" />
         <Context path="" docBase="c:\Inetpub\wwwroot" debug="0" privileged="true" />
    <Context path="/sharon" docBase="C:\Tomcat 4.1\webapps\sharon" debug="0" privileged="true" />
    <!-- Normally, users must authenticate themselves to each web app
    individually. Uncomment the following entry if you would like
    a user to be authenticated the first time they encounter a
    resource protected by a security constraint, and then have that
    user identity maintained across all web applications contained
    in this virtual host. -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn"
    debug="0"/>
    -->
    <!-- Access log processes all requests for this virtual host. By
    default, log files are created in the "logs" directory relative to
    $CATALINA_HOME. If you wish, you can specify a different
    directory with the "directory" attribute. Specify either a relative
    (to $CATALINA_HOME) or absolute path to the desired directory.
    -->
    <!--
    <Valve className="org.apache.catalina.valves.AccessLogValve"
    directory="logs" prefix="localhost_access_log." suffix=".txt"
    pattern="common" resolveHosts="false"/>
    -->
    <!-- Logger shared by all Contexts related to this virtual host. By
    default (when using FileLogger), log files are created in the "logs"
    directory relative to $CATALINA_HOME. If you wish, you can specify
    a different directory with the "directory" attribute. Specify either a
    relative (to $CATALINA_HOME) or absolute path to the desired
    directory.-->
    <Logger className="org.apache.catalina.logger.FileLogger"
    directory="logs" prefix="localhost_log." suffix=".txt"
         timestamp="true"/>
    <!-- Define properties for each web application. This is only needed
    if you want to set non-default properties, or have web application
    document roots in places other than the virtual host's appBase
    directory. -->
    <!-- Tomcat Root Context -->
    <!--
    <Context path="" docBase="ROOT" debug="0"/>
    -->
    <!-- Tomcat Examples Context -->
    <Context path="/examples" docBase="examples" debug="0"
    reloadable="true" crossContext="true">
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="localhost_DBTest_log." suffix=".txt"
    timestamp="true"/>
    <Ejb name="ejb/EmplRecord" type="Entity"
    home="com.wombat.empl.EmployeeRecordHome"
    remote="com.wombat.empl.EmployeeRecord"/>
    <!-- If you wanted the examples app to be able to edit the
    user database, you would uncomment the following entry.
    Of course, you would want to enable security on the
    application as well, so this is not done by default!
    The database object could be accessed like this:
    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    UserDatabase database =
    (UserDatabase) envCtx.lookup("userDatabase");
    -->
    <!--
    <ResourceLink name="userDatabase" global="UserDatabase"
    type="org.apache.catalina.UserDatabase"/>
    -->
    <!-- PersistentManager: Uncomment the section below to test Persistent
              Sessions.
    saveOnRestart: If true, all active sessions will be saved
    to the Store when Catalina is shutdown, regardless of
    other settings. All Sessions found in the Store will be
    loaded on startup. Sessions past their expiration are
    ignored in both cases.
    maxActiveSessions: If 0 or greater, having too many active
    sessions will result in some being swapped out. minIdleSwap
    limits this. -1 means unlimited sessions are allowed.
    0 means sessions will almost always be swapped out after
    use - this will be noticeably slow for your users.
    minIdleSwap: Sessions must be idle for at least this long
    (in seconds) before they will be swapped out due to
    maxActiveSessions. This avoids thrashing when the site is
    highly active. -1 or 0 means there is no minimum - sessions
    can be swapped out at any time.
    maxIdleSwap: Sessions will be swapped out if idle for this
    long (in seconds). If minIdleSwap is higher, then it will
    override this. This isn't exact: it is checked periodically.
    -1 means sessions won't be swapped out for this reason,
    although they may be swapped out for maxActiveSessions.
    If set to >= 0, guarantees that all sessions found in the
    Store will be loaded on startup.
    maxIdleBackup: Sessions will be backed up (saved to the Store,
    but left in active memory) if idle for this long (in seconds),
    and all sessions found in the Store will be loaded on startup.
    If set to -1 sessions will not be backed up, 0 means they
    should be backed up shortly after being used.
    To clear sessions from the Store, set maxActiveSessions, maxIdleSwap,
    and minIdleBackup all to -1, saveOnRestart to false, then restart
    Catalina.
    -->
              <!--
    <Manager className="org.apache.catalina.session.PersistentManager"
    debug="0"
    saveOnRestart="true"
    maxActiveSessions="-1"
    minIdleSwap="-1"
    maxIdleSwap="-1"
    maxIdleBackup="-1">
    <Store className="org.apache.catalina.session.FileStore"/>
    </Manager>
              -->
    <Environment name="maxExemptions" type="java.lang.Integer"
    value="15"/>
    <Parameter name="context.param.name" value="context.param.value"
    override="false"/>
    <Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
    type="javax.sql.DataSource"/>
    <Resource name="jdbc/TestDB"
         auth="Container"
         type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/TestDB">
    <parameter>
         <name>factory</name>
         <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
         </parameter>
         <!-- Maximum number of dB connections in pool. Make sure you
         configure your mysqld max_connections large enough to handle
         all of your db connections. Set to 0 for no limit.
         -->
         <parameter>
         <name>maxActive</name>
         <value>100</value>
         </parameter>
         <!-- Maximum number of idle dB connections to retain in pool.
         Set to 0 for no limit.
         -->
         <parameter>
         <name>maxIdle</name>
         <value>30</value>
         </parameter>
         <!-- Maximum time to wait for a dB connection to become available
         in ms, in this example 10 seconds. An Exception is thrown if
         this timeout is exceeded. Set to -1 to wait indefinitely.
         -->
         <parameter>
         <name>maxWait</name>
         <value>10000</value>
         </parameter>
    <!-- MySQL dB username and password for dB connections -->
    <parameter>
    <name>user</name>
    <value>javauser</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>javadude</value>
    </parameter>
    <!-- Class name for mm.mysql JDBC driver -->
    <parameter>
    <name>driverClassName</name>
    <value>org.gjt.mm.mysql.Driver</value>
    </parameter>
    <!-- The JDBC connection url for connecting to your MySQL dB.
         The autoReconnect=true argument to the url makes sure that the
         mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
         connection. mysqld by default closes idle connections after 8 hours.
         -->
         <parameter>
         <name>url</name>
         <value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
    </parameter>
    </ResourceParams>
    <Resource name="mail/Session" auth="Container"
    type="javax.mail.Session"/>
    <ResourceParams name="mail/Session">
    <parameter>
    <name>mail.smtp.host</name>
    <value>localhost</value>
    </parameter>
    </ResourceParams>
    <ResourceLink name="linkToGlobalResource"
    global="simpleValue"
    type="java.lang.Integer"/>
    </Context>
    </Host>
    </Engine>
    </Service>
    <!-- The MOD_WEBAPP connector is used to connect Apache 1.3 with Tomcat 4.0
    as its servlet container. Please read the README.txt file coming with
    the WebApp Module distribution on how to build it.
    (Or check out the "jakarta-tomcat-connectors/webapp" CVS repository)
    To configure the Apache side, you must ensure that you have the
    "ServerName" and "Port" directives defined in "httpd.conf". Then,
    lines like these to the bottom of your "httpd.conf" file:
    LoadModule webapp_module libexec/mod_webapp.so
    WebAppConnection warpConnection warp localhost:8008
    WebAppDeploy examples warpConnection /examples/
    The next time you restart Apache (after restarting Tomcat, if needed)
    the connection will be established, and all applications you make
    visible via "WebAppDeploy" directives can be accessed through Apache.
    -->
    <!-- Define an Apache-Connector Service -->
    <!--
    <Service name="Tomcat-Apache">
    <Connector className="org.apache.catalina.connector.warp.WarpConnector"
    port="8008" minProcessors="5" maxProcessors="75"
    enableLookups="true" appBase="webapps"
    acceptCount="10" debug="0"/>
    <Engine className="org.apache.catalina.connector.warp.WarpEngine"
    name="Apache" debug="0">
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="apache_log." suffix=".txt"
    timestamp="true"/>
    <Realm className="org.apache.catalina.realm.MemoryRealm" />
    </Engine>
    </Service>
    -->
    </Server>
    Pleas4 help!!!

    you have your driver jar in Tomcat\common\lib?
    if so, check your classpath, it could be that.

  • Best way to use Sun Web Server connection pooling with Web Application?

    I have a number of applications that run Oracle and MySQL queries via Sun Web Server 6.1. I use the Web Server's built-in connection pooling, which works fairly well.
    As an interface with the connections I receive from the Web Server, I use a class, which (1) accepts the SQL and database name from a tool, (2) Opens the connection, runs the SQL, closes the connection, (3) puts the content of the result set into a Vector of Hashtables, (4) returns that Vector to the tool.
    Why do I use this Vector? That way, in my applications, I don't have to deal with opening connections (or getting them from the pool) and I don't have to worry about closing connections, because that's done automatically by the interface class.
    Is this a dumb approach to use? I'm a bit paranoid about open DB connections, because we have had a number of problems where connections would not be closed, go stale in oracle, and clog up the database resources.
    Can you suggest a better way to (1) smartly control opening and closing connections, and (2) enabling fast database access?
    Sorry, but given this Java/Sun Web Server double topic, I'm going to post the same message on the Web Server board.
    Any tips?
    dailysun
    P.S. For instance, in my tool, I call the interface class in this manner:
    Vector results_v = Database.getSelect("SELECT * FROM TEST","database1");
    getSelect uses the first string as the SQL and the second string as the jndi name of the Web server's database resource. getSelect does all the context stuff to get a connection from the pool, runs the SQL, puts the resultset into a Vector of Hastables (where each row is one Hashtable), and returns the Vector.

    I have a number of applications that run Oracle and MySQL queries via Sun Web Server 6.1. I use the Web Server's built-in connection pooling, which works fairly well.
    As an interface with the connections I receive from the Web Server, I use a class, which (1) accepts the SQL and database name from a tool, (2) Opens the connection, runs the SQL, closes the connection, (3) puts the content of the result set into a Vector of Hashtables, (4) returns that Vector to the tool.
    Why do I use this Vector? That way, in my applications, I don't have to deal with opening connections (or getting them from the pool) and I don't have to worry about closing connections, because that's done automatically by the interface class.
    Is this a dumb approach to use? I'm a bit paranoid about open DB connections, because we have had a number of problems where connections would not be closed, go stale in oracle, and clog up the database resources.
    Can you suggest a better way to (1) smartly control opening and closing connections, and (2) enabling fast database access?
    Sorry, but given this Java/Sun Web Server double topic, I'm going to post the same message on the Web Server board.
    Any tips?
    dailysun
    P.S. For instance, in my tool, I call the interface class in this manner:
    Vector results_v = Database.getSelect("SELECT * FROM TEST","database1");
    getSelect uses the first string as the SQL and the second string as the jndi name of the Web server's database resource. getSelect does all the context stuff to get a connection from the pool, runs the SQL, puts the resultset into a Vector of Hastables (where each row is one Hashtable), and returns the Vector.

  • Issue JDBC connection pool with Glassfish 3.1.2.2 and Oracle XE 11gR2

    Hello,
    I am experiencing an issue with pinging a JDBC connection Pool.
    I installed the following without any warnings or errors:
    Operating System: Oracle Enterprise Linux 5
    Oracle XE 11gR2 (11.2.0.2.0) database
    Glassfish 3.1.2.2
    I will refer to the steps I did after the installations
    1) In the .profile file of the OS I add the following:
    JRE_HOME=/usr/java/jre1.6.0_31; export JRE_HOME
    JAVA_HOME=/usr/java/jdk1.6.0_31; export JAVA_HOME
    GLASSFISH_DIR=/u01/glassfish3
    GLASSFISH_HOME=/u01/glassfish3/glassfish
    DERBY_HOME=$GLASSFISH_DIR/javadb
    OPEN_MQ_HOME=$GLASSFISH_DIR/mq
    PATH=:$JAVA_HOME/bin:$JRE_HOME/bin:$PATH:$HOME/bin:$GLASSFISH_HOME/bin:$DERBY_HOME/bin:$OPEN_MQ_HOME/bin
    export GLASSFISH_HOME
    export DERBY_HOME
    export OPEN_MQ_HOME
    export PATH
    LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib; export LD_LIBRARY_PATH
    . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
    2) I copied the ojdbc6.jar to the $GLASSFISH_HOME/domains/domain1/lib
    3) I login to the Glassfish admin console and created a new JDBC Connection Pool.
    Pool Name: ds_orasys
    Resource Type: javax.sql.DataSource
    Datasource Classname: oracle.jdbc.pool.OracleDataSource
    User: [myschema]
    Password: [myschema password]
    URL: jdbc:oracle:thin:@localhost:1521:xe
    When I ping the connection pool I get the following message in the server log:
    [#|2012-10-23T12:14:37.069+0300|WARNING|glassfish3.1.2|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service|_ThreadID=22;_ThreadName=Thread-2;|RAR8054: Exception while creating an unpooled [test] connection for pool [ ds_orasys ], Connection could not be allocated because: Invalid Oracle URL specified|#]
    [#|2012-10-23T12:14:37.071+0300|SEVERE|glassfish3.1.2|org.glassfish.admingui|_ThreadID=19;_ThreadName=Thread-2;|RestResponse.getResponse() gives FAILURE. endpoint = 'http://212.205.62.217:4848/management/domain/resources/ping-connection-pool.json'; attrs = '{id=ds_orasys}'|#]
    I tried to use different jar files. I used ojdbc6dms.jar and ojdbc14.jar.
    I also copied the jar files in the $GLASSFISH_HOME/domains/domain1/lib/ext directory as some people suggested. Still no luck. I keep getting the same error messages in the server.log
    Can anybody help me out or point me to the right direction.
    Thank you in advance

    The error is in the URL. It was in front of my eyes and I couldn't see the error. I skipped the ':' before the '@' when I created the pool. It is working fine now.

  • Problem in DBCP Connection Pooling with BLOB in Tomcat

    Hi All,
    I am using the DBCP connection pooling in tomcat server version 6.0.18.
    I have session table which maintains the session details of the user in BLOB column. Recently I am facing a problem. When a user logs in, I am storing the session details in the DB. It throws an exception like this. When I restart the tomcat, it just works fine. But after some days it is again throwing the same exception.
    Code:
    2009-01-27 06:03:13,789 DEBUG [org.springframework.jdbc.core.JdbcTemplate] - Executing prepared SQL statement [INSERT INTO SESSION (SESSION_CODE,LAST_ACCESS,VALID_SESSION,SESSION_DATA) VALUES(?,?,?,?)]
    2009-01-27 06:03:13,789 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@154136a] for key [org.apache.commons.dbcp.BasicDataSource@bdec44] bound to thread [http-8443-6]
    2009-01-27 06:03:13,789 DEBUG [org.springframework.jdbc.core.StatementCreatorUtils] - Setting SQL statement parameter value: column index 1, parameter value [c2896a488efb7fe15430fab10d502577], value class [java.lang.String], SQL type unknown
    2009-01-27 06:03:13,789 DEBUG [org.springframework.jdbc.core.StatementCreatorUtils] - Setting SQL statement parameter value: column index 2, parameter value [1233064993], value class [java.lang.Long], SQL type unknown
    2009-01-27 06:03:13,789 DEBUG [org.springframework.jdbc.core.StatementCreatorUtils] - Setting SQL statement parameter value: column index 3, parameter value [1], value class [java.lang.Integer], SQL type unknown
    2009-01-27 06:03:13,789 DEBUG [org.springframework.jdbc.core.StatementCreatorUtils] - Setting SQL statement parameter value: column index 4, parameter value [org.springframework.jdbc.core.support.SqlLobValue@18af32e], value class [org.springframework.jdbc.core.support.SqlLobValue], SQL type 2004
    2009-01-27 06:03:13,789 DEBUG [org.springframework.jdbc.support.lob.DefaultLobHandler] - Set bytes for BLOB with length 390
    2009-01-27 06:03:13,789 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@154136a] for key [org.apache.commons.dbcp.BasicDataSource@bdec44] bound to thread [http-8443-6]
    2009-01-27 06:03:13,790 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@154136a] for key [org.apache.commons.dbcp.BasicDataSource@bdec44] bound to thread [http-8443-6]
    2009-01-27 06:03:13,790 DEBUG [org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator] - Unable to translate SQLException with Error code '17410', will now try the fallback translator
    2009-01-27 06:03:13,790 INFO [web.controller.LoginController] - Caught Exception while creating sesion in DB
    2009-01-27 06:03:13,790 DEBUG [org.springframework.jdbc.datasource.DataSourceTransactionManager] - Triggering beforeCompletion synchronization
    2009-01-27 06:03:13,790 DEBUG [org.springframework.jdbc.datasource.DataSourceTransactionManager] - Initiating transaction rollback
    2009-01-27 06:03:13,790 DEBUG [org.springframework.jdbc.datasource.DataSourceTransactionManager] - Rolling back JDBC transaction on Connection [jdbc:oracle:thin:@stagedb1c:2115:WEB1C, UserName=WEBAPP, Oracle JDBC driver]
    2009-01-27 06:03:13,791 DEBUG [org.springframework.jdbc.datasource.DataSourceTransactionManager] - Triggering afterCompletion synchronization
    2009-01-27 06:03:13,791 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - Clearing transaction synchronization
    2009-01-27 06:03:13,791 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - Removed value [org.springframework.jdbc.datasource.ConnectionHolder@154136a] for key [org.apache.commons.dbcp.BasicDataSource@bdec44] from thread [http-8443-6]
    2009-01-27 06:03:13,791 DEBUG [org.springframework.jdbc.datasource.DataSourceTransactionManager] - Releasing JDBC Connection [connection is closed] after transaction
    2009-01-27 06:03:13,791 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - Returning JDBC Connection to DataSource
    2009-01-27 06:03:13,791 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - Could not close JDBC Connection
    java.sql.SQLException: Already closed.
    at org.apache.commons.dbcp.PoolableConnection.close(PoolableConnection.java:84)
    at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:181)
    at org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection(DataSourceUtils.java:313)
    at org.springframework.jdbc.datasource.DataSourceUtils.releaseConnection(DataSourceUtils.java:274)
    at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCleanupAfterCompletion(DataSourceTransactionManager.java:316)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:966)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:832)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:777)
    at web.controller.LoginController.onSubmit(LoginController.java:109)
    at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:267)
    at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:265)
    at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
    at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:595)
    My Session table has the following structure:
    Code:
    Name Null? Type
    SESSION_CODE NOT NULL VARCHAR2(100)
    LAST_ACCESS NOT NULL NUMBER
    VALID_SESSION NOT NULL NUMBER
    SESSION_DATA NOT NULL BLOB
    I have the following in the Spring context file :
    Code:
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="${jdbc.driverClassName}"/>
    <property name="url" value="${jdbc.url}"/>
    <property name="username" value="${jdbc.username}"/>
    <property name="password" value="${jdbc.password}"/>
    <property name="initialSize" value="5"/>
    <property name="maxActive" value="5"/>
    <property name="minIdle" value="2"/>
    <property name="poolPreparedStatements" value="true"/>
    <property name="defaultAutoCommit" value="false"/>
    </bean>
    I am using the oracle.jdbc.driver.OracleDriver as jdbc driver. And also using the commons-dbcp-1.2.2.jar and ojdbc14.jar.
    Can some one help me out to solve this issue?
    Thanks in Advance.

    I am also facing the same problem, please let me know if there any suggestions,
    DEBUG|2010-05-07 16:41:25,866|main|(SQLErrorCodeSQLExceptionTranslator.java:266)|org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator|Unable to translate SQLException with Error code '17410', will now try the fallback translator
    DEBUG|2010-05-07 16:41:25,866|main|(SQLStateSQLExceptionTranslator.java:94)|org.springframework.jdbc.support.SQLStateSQLExceptionTranslator|Extracted SQL state class '08' from value '08000'
    thanks
    sundaravel n

  • How can I use the Connection Pool with DB2

    Hi All,
    I am facing the problem with the usage for the Connection Pool.
    I want to use DB2 via JNDI lookup.
    But when starting the Weblogic server, Error occured with the following message.
    <Error> <JDBC> <Cannot startup connection pool "MyJDBCPool" Cannot load driver class : com.ibm.db2.jdbc.app.DB2Driver>
    DB2 and Weblogic are on the same machine.
    In case of the use of remote DB2 database, I also encountered the same error.
    Configurations are as follows.
    <JDBCConnectionPool DriverName="com.ibm.db2.jdbc.app.DB2Driver"
    MaxCapacity="10" Name="MyJDBCPool"
    Password="{3DES}gCGsOfD9M6iwOtgL2v/NpA==" Targets="myserver"
    TestConnectionsOnReserve="false" TestTableName="test" URL="jdbc:db2://localhost:6789/yongjoo"/>
    <SNMPAgent Name="mydomain"/>
    <JDBCDataSource JNDIName="acsdb" Name="acsdb" PoolName="MyJDBCPool" Targets="myserver"/>
    Could you please give some information about this problem? I will appreciate your kindness.

    Hi Joe,
    Thanks your help.
    Perhaps It's my fault for Weblogic console's setting.
    After I reset the target server in console, Error message disappeared.
    But, when I call the TestCode, I encountered another error message. The error
    is NameNotFoundException.
    When lookingup the JNDI name, NameNotFoundException errer occured. I tried to
    change my setting and JNDI name, but the results are the same.
    Would you please give me some information about this one more time? I will be
    appreciated for your help.
    Follows are Config.xml
    <JDBCConnectionPool DriverName="com.ibm.db2.jdbc.app.DB2Driver" MaxCapacity="10"
    Name="MyJDBCPool" Password="{3DES}gCGsOfD9M6iwOtgL2v/NpA==" Targets="myserver"
    TestConnectionsOnReserve="false" TestTableName="test"
    URL="jdbc:db2://localhost:6789/yongjoo"/> <SNMPAgent Name="mydomain"/>
    <JDBCDataSource JNDIName="acsdb" Name="acsdb" PoolName="MyJDBCPool"
    Targets="myserver"/>
    and follows are TestCode,
    url = "t3://localhost:7001"; //default URL
    datasource = "jdbc/acsdb";
    Context ctx = null;
    Hashtable p = new Hashtable();
    p.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    p.put(Context.PROVIDER_URL, url);
    try{
    ctx = new InitialContext(p);
    System.err.println("initialContext(p)"+ctx); <-- success
    ds = (DataSource)ctx.lookup("java:comp/env/jdbc/acsdb");
    }catch(NameNotFoundException ne){
    throw new ConnectionException(); .
    }catch(NamingException ne){
    throw new ConnectionException();

  • Hoe to connect java with mysql 5.0

    I have installed the new Os. in that RHE-5 Os is there, now I want that java can connect ot mysql but , its not able connect with mysql so please guide me.

    1) download mysql connector/J JDBC driver from mysql.com
    2) put the driver jar somewhere where you can put it in the classpath of your application
    3) use proper setup code to connect to the database (search google, tons of examples)
    If at any step you have no clue what I am talking about, you need a good book to help you further.

Maybe you are looking for

  • Editing Final Cut Studio Projects on Final Cut X

    Has anyone heard if you will ever be able to edit older Final Cut projects on the FC X?

  • C3-01 Screen Protector Recommendation Please

    Need a recommendation for a good, ultra clear top of the line fitted custom screen protector for the C3-01.  Also need a powered usb cable.  I am in the US. Just got the C3-01 and am really impressed for a dumb phone, its the Nokia suite and updating

  • Exam 1Z0-047

    Did anyone buy the new OCA Oracle Database SQL Expert Exam Guide: Exam 1Z0-047 ? Is it good in preparing for the exam.Is it better than Oracle Database 11g: SQL Fundamentals or Oracle Database 11g SQL in helping you to pass the 1Z0-047 Exam

  • Where is the easy answer for getting all music, purchased or not, from the nano to my itunes library again?

    I can't believe that Apple doesn't have a way for Nano owners to put their music on their Nano back on their pc's in the itunes library after it is erased by their 14 year old son!!  I have a music collection on there, purchased and from CD's, and I

  • Oracle Portal & 9iAS Database Cache

    Has anyone used Oracle 9iAS database cache to speed up document retrieval from Portal? Can Portal be used to cache Portal documents remotely?? Any help greatly appreciated