Re: Re: Re: ConnectionPooling
Thanks Doug,Harry and rest of my friends, After going thru the links ,I was able to make it work.Before I end this thread I just want to clarify some doubts.I am querying a database ,but I have some delay getting back the results.Now I want to check if the query is causing the delay or am I going wrong with allocating connections.So,I want to log all my program steps in a log file,can u just tell me what code I have to add and where?? Would this code help me?? Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Looking for these answers and thanks for your generous help. cheers. On Thu, 20 Jan 2005 Parsons Technical Services wrote : People who have to figure out how to use other peoples work either have messy hair or are bald. There are three main pages for reference: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/globalresources.html Now the basics. There are four pieces to the puzzle. I am going for a Global Setup. First is the server.xml Resource and ResourceParams elements. It appears that you have these. Connects to the database and create a pool of connections. Second is the web.xml entry for the resource-ref. Third is the Resource link placed in the apps context. Fourth is the calling of the resource from code. When you say use to BasicDataSource to see thw no. of active connections is this you application or something built into Tomcat? Doug - Original Message - From: micky none [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Wednesday, January 19, 2005 4:54 PM Subject: Re: Re: ConnectionPooling Tried that too my friend,isn't there any sure shot answer for this one..im like half mad after this...as of now. On Thu, 20 Jan 2005 Harry Mantheakis wrote : This may not help, but try swapping the order of the ResourceParams and Resource elements in your 'server.xml' file. Also, you seem to be declaring the DefaultContext element three times (!) which seems wrong. HTH Harry Mantheakis Hi Friends, This is my first message on this list.I want to use the dbcp connection pooling.I set up the server.xml according to an example,but when i trying to use to BasicDataSource to see thw no. of active connections it's throwing errors.I tried searching a lot but to no use.If I go into the administrator tool,it shows nothing there?I am using tomcat5.0..please tell me ..where i am going wrong and if there is any other way to see the number of active connections. Here's my server.xml,please tell me if there's anything wrong with it: Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true / DefaultContext reloadable=true / DefaultContext path=/database docBase=database debug=0 reloadable=true / - DefaultContext - ResourceParams name=jdbc/conversion - parameter nameusername/name value/value /parameter - parameter namepassword/name value/value /parameter - parameter namedriverClassName/name valuecom.ibm.db2.jcc.DB2Driver/value /parameter - parameter nameurl/name valuejdbc:db2j:net/value /parameter - parameter nameremoveAbandoned/name valuetrue/value /parameter - parameter nameremoveAbandonedTimeout/name value0/value /parameter - parameter namelogAbandoned/name valuetrue/value /parameter - parameter namemaxActive/name value1/value /parameter - parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter /ResourceParams Resource name=jdbc/conversion auth=Container type=javax.sql.DataSource / /DefaultContext Loader className=org.apache.catalina.loader.WebappLoader loaderClass=org.apache.catalina.loader.WebappClassLoader checkInterval=3 / /Host please,please,please help me...its very urgent. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Re: ConnectionPooling
http://logging.apache.org/log4j/docs/manual.html You really need to read something like this. Logging is an important step into building an app, so you have to sacrifice now some time for learning how to do it. Viorel Dragomir . .. --- - Original Message - From: micky none To: Tomcat Users List Sent: Thursday, January 20, 2005 16:14 Subject: Re: Re: Re: ConnectionPooling Thanks Doug,Harry and rest of my friends, After going thru the links ,I was able to make it work.Before I end this thread I just want to clarify some doubts.I am querying a database ,but I have some delay getting back the results.Now I want to check if the query is causing the delay or am I going wrong with allocating connections.So,I want to log all my program steps in a log file,can u just tell me what code I have to add and where?? Would this code help me?? Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_DBTest_log. suffix=.txt timestamp=true/ Looking for these answers and thanks for your generous help. cheers. On Thu, 20 Jan 2005 Parsons Technical Services wrote : People who have to figure out how to use other peoples work either have messy hair or are bald. There are three main pages for reference: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/globalresources.html Now the basics. There are four pieces to the puzzle. I am going for a Global Setup. First is the server.xml Resource and ResourceParams elements. It appears that you have these. Connects to the database and create a pool of connections. Second is the web.xml entry for the resource-ref. Third is the Resource link placed in the apps context. Fourth is the calling of the resource from code. When you say use to BasicDataSource to see thw no. of active connections is this you application or something built into Tomcat? Doug - Original Message - From: micky none [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Wednesday, January 19, 2005 4:54 PM Subject: Re: Re: ConnectionPooling Tried that too my friend,isn't there any sure shot answer for this one..im like half mad after this...as of now. On Thu, 20 Jan 2005 Harry Mantheakis wrote : This may not help, but try swapping the order of the ResourceParams and Resource elements in your 'server.xml' file. Also, you seem to be declaring the DefaultContext element three times (!) which seems wrong. HTH Harry Mantheakis Hi Friends, This is my first message on this list.I want to use the dbcp connection pooling.I set up the server.xml according to an example,but when i trying to use to BasicDataSource to see thw no. of active connections it's throwing errors.I tried searching a lot but to no use.If I go into the administrator tool,it shows nothing there?I am using tomcat5.0..please tell me ..where i am going wrong and if there is any other way to see the number of active connections. Here's my server.xml,please tell me if there's anything wrong with it: Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true / DefaultContext reloadable=true / DefaultContext path=/database docBase=database debug=0 reloadable=true / - DefaultContext - ResourceParams name=jdbc/conversion - parameter nameusername/name value/value /parameter - parameter namepassword/name value/value /parameter - parameter namedriverClassName/name valuecom.ibm.db2.jcc.DB2Driver/value /parameter - parameter nameurl/name valuejdbc:db2j:net/value /parameter - parameter nameremoveAbandoned/name valuetrue/value /parameter - parameter nameremoveAbandonedTimeout/name value0/value /parameter - parameter namelogAbandoned/name valuetrue/value /parameter - parameter namemaxActive/name value1/value /parameter - parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter /ResourceParams Resource name=jdbc/conversion auth=Container type=javax.sql.DataSource / /DefaultContext Loader className=org.apache.catalina.loader.WebappLoader loaderClass=org.apache.catalina.loader.WebappClassLoader checkInterval=3 / /Host please,please,please help me...its very urgent. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: ConnectionPooling
Tried that too my friend,isn't there any sure shot answer for this one..im like half mad after this...as of now. On Thu, 20 Jan 2005 Harry Mantheakis wrote : This may not help, but try swapping the order of the ResourceParams and Resource elements in your 'server.xml' file. Also, you seem to be declaring the DefaultContext element three times (!) which seems wrong. HTH Harry Mantheakis Hi Friends, This is my first message on this list.I want to use the dbcp connection pooling.I set up the server.xml according to an example,but when i trying to use to BasicDataSource to see thw no. of active connections it's throwing errors.I tried searching a lot but to no use.If I go into the administrator tool,it shows nothing there?I am using tomcat5.0..please tell me ..where i am going wrong and if there is any other way to see the number of active connections. Here's my server.xml,please tell me if there's anything wrong with it: Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true / DefaultContext reloadable=true / DefaultContext path=/database docBase=database debug=0 reloadable=true / - DefaultContext - ResourceParams name=jdbc/conversion - parameter nameusername/name value/value /parameter - parameter namepassword/name value/value /parameter - parameter namedriverClassName/name valuecom.ibm.db2.jcc.DB2Driver/value /parameter - parameter nameurl/name valuejdbc:db2j:net/value /parameter - parameter nameremoveAbandoned/name valuetrue/value /parameter - parameter nameremoveAbandonedTimeout/name value0/value /parameter - parameter namelogAbandoned/name valuetrue/value /parameter - parameter namemaxActive/name value1/value /parameter - parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter /ResourceParams Resource name=jdbc/conversion auth=Container type=javax.sql.DataSource / /DefaultContext Loader className=org.apache.catalina.loader.WebappLoader loaderClass=org.apache.catalina.loader.WebappClassLoader checkInterval=3 / /Host please,please,please help me...its very urgent. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: ConnectionPooling
People who have to figure out how to use other peoples work either have messy hair or are bald. There are three main pages for reference: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/globalresources.html Now the basics. There are four pieces to the puzzle. I am going for a Global Setup. First is the server.xml Resource and ResourceParams elements. It appears that you have these. Connects to the database and create a pool of connections. Second is the web.xml entry for the resource-ref. Third is the Resource link placed in the apps context. Fourth is the calling of the resource from code. When you say use to BasicDataSource to see thw no. of active connections is this you application or something built into Tomcat? Doug - Original Message - From: micky none [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Wednesday, January 19, 2005 4:54 PM Subject: Re: Re: ConnectionPooling Tried that too my friend,isn't there any sure shot answer for this one..im like half mad after this...as of now. On Thu, 20 Jan 2005 Harry Mantheakis wrote : This may not help, but try swapping the order of the ResourceParams and Resource elements in your 'server.xml' file. Also, you seem to be declaring the DefaultContext element three times (!) which seems wrong. HTH Harry Mantheakis Hi Friends, This is my first message on this list.I want to use the dbcp connection pooling.I set up the server.xml according to an example,but when i trying to use to BasicDataSource to see thw no. of active connections it's throwing errors.I tried searching a lot but to no use.If I go into the administrator tool,it shows nothing there?I am using tomcat5.0..please tell me ..where i am going wrong and if there is any other way to see the number of active connections. Here's my server.xml,please tell me if there's anything wrong with it: Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true / DefaultContext reloadable=true / DefaultContext path=/database docBase=database debug=0 reloadable=true / - DefaultContext - ResourceParams name=jdbc/conversion - parameter nameusername/name value/value /parameter - parameter namepassword/name value/value /parameter - parameter namedriverClassName/name valuecom.ibm.db2.jcc.DB2Driver/value /parameter - parameter nameurl/name valuejdbc:db2j:net/value /parameter - parameter nameremoveAbandoned/name valuetrue/value /parameter - parameter nameremoveAbandonedTimeout/name value0/value /parameter - parameter namelogAbandoned/name valuetrue/value /parameter - parameter namemaxActive/name value1/value /parameter - parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter /ResourceParams Resource name=jdbc/conversion auth=Container type=javax.sql.DataSource / /DefaultContext Loader className=org.apache.catalina.loader.WebappLoader loaderClass=org.apache.catalina.loader.WebappClassLoader checkInterval=3 / /Host please,please,please help me...its very urgent. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]