RE: db connection pooling
Use jakarat DBCP. If you read thru tomcat's (that is if you use tomcat) howto's they explain how to set it up. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 12:39 AM To: [EMAIL PROTECTED] Subject: db connection pooling Hi, Is there any ways to achieve db connection pooling and access of such pooled connection though jndi in struts action classes. Regards, Jailani.S - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: db connection pooling
On Mon, 7 Jul 2003 [EMAIL PROTECTED] wrote: Date: Mon, 7 Jul 2003 10:09:08 +0530 From: [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: db connection pooling Hi, Is there any ways to achieve db connection pooling and access of such pooled connection though jndi in struts action classes. JNDI-based data sources are a feature of any J2EE app server, and some servlet containers (such as Tomcat). They can easily be used in a Struts Action. One of the many conveniences of this approach is that the resources are configured externally -- you don't need to mess with web.xml or struts-config.xml for them. So, for example, the exact same WAR file can be deployed on a test machine and a production machine, with the server resource configuration pointing you at the appropriate test or production database. Configuration details will depend on your server -- here's the docs for Tomcat: http://jakarta.apache.org/tomcat/tomcat-4.1-docs/jndi-resources-howto.html http://jakarta.apache.org/tomcat/tomcat-4.1-docs/jndi-datasource-examples-howto.html Regards, Jailani.S Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
db connection pooling
Hi, Is there any ways to achieve db connection pooling and access of such pooled connection though jndi in struts action classes. Regards, Jailani.S This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited. Visit Us at http://www.polaris.co.in - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: db connection pooling
why not? Simply configure one jndi data source in struts-config and you are on. HTH -navjot |-Original Message- |From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] |Sent: Monday, July 07, 2003 10:09 AM |To: [EMAIL PROTECTED] |Subject: db connection pooling | | |Hi, | |Is there any ways to achieve db connection pooling and access of such |pooled connection though jndi in struts action classes. | |Regards, |Jailani.S | | | | | - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: db connection pooling
That depends upon the Server Infrastruture. U can implement connection pooling and Datasournce throught the strutsconfig datasournce seqment. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 10:09 AM To: [EMAIL PROTECTED] Subject: db connection pooling Hi, Is there any ways to achieve db connection pooling and access of such pooled connection though jndi in struts action classes. Regards, Jailani.S This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful. Visit us at http://www.cognizant.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: db connection pooling
Use a plugin. At 10:09 AM 7/7/03 +0530, you wrote: Hi, Is there any ways to achieve db connection pooling and access of such pooled connection though jndi in struts action classes. Regards, Jailani.S - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] LEGAL NOTICE This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to use datasource and db connection pooling in struts?
Hi, there! How can I easily achieve database connection pooling (using a datasource in one of the xml config files - btw. which one is it?)? I know there is some stuff in jakarta-commons. What I want to achieve is an easy to configure and highly efficient db connection pool that is available to all my action classes. Stef. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to use datasource and db connection pooling in struts?
you can use commons-dbcp ... see http://jakarta.apache.org/commons/dbcp.html --- - Nayan Hajratwala - Chikli Consulting LLC - http://www.chikli.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 15, 2002 10:40 AM To: [EMAIL PROTECTED] Subject: How to use datasource and db connection pooling in struts? Hi, there! How can I easily achieve database connection pooling (using a datasource in one of the xml config files - btw. which one is it?)? I know there is some stuff in jakarta-commons. What I want to achieve is an easy to configure and highly efficient db connection pool that is available to all my action classes. Stef. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to use datasource and db connection pooling in struts?
Taking advantage of this thread. Has any of you had the experience of using a connection provided by the Websphere pool to handle connected components, i.e. Struct or ARRAY in Oracle. We are getting a ClassCastException since driver attempts to cast the connection to an OracleConnection, and WAS pool provided connection does not implement OracleConnection since is a connection provided by IBM classes. Any workaround? We are stuck with this issue. If you ask to IBM support they probably response you to use DB2 so not really helpful. Any experience? TIA, Adolfo. From: Hajratwala, Nayan (N.) [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: How to use datasource and db connection pooling in struts? Date: Tue, 15 Oct 2002 10:42:13 -0400 you can use commons-dbcp ... see http://jakarta.apache.org/commons/dbcp.html --- - Nayan Hajratwala - Chikli Consulting LLC - http://www.chikli.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 15, 2002 10:40 AM To: [EMAIL PROTECTED] Subject: How to use datasource and db connection pooling in struts? Hi, there! How can I easily achieve database connection pooling (using a datasource in one of the xml config files - btw. which one is it?)? I know there is some stuff in jakarta-commons. What I want to achieve is an easy to configure and highly efficient db connection pool that is available to all my action classes. Stef. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How to use datasource and db connection pooling in struts?
struts-config.xml is where you define your datasources. You specify the key to store the DataSource object under in the application scope so your actions can find it later. You also have to specify the DataSource implementation class to use. Often this will be provided by your database vendor but if it isn't, you can use the datasource provided by jakarta-commons dbcp BasicDataSource as suggested in a previous reply. See section 4.6.5 for configuration info: http://jakarta.apache.org/struts/userGuide/building_controller.html Dave From: [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: How to use datasource and db connection pooling in struts? Date: Tue, 15 Oct 2002 16:40:27 +0200 Hi, there! How can I easily achieve database connection pooling (using a datasource in one of the xml config files - btw. which one is it?)? I know there is some stuff in jakarta-commons. What I want to achieve is an easy to configure and highly efficient db connection pool that is available to all my action classes. Stef. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to use datasource and db connection pooling in struts?
If I'm getting this right, I could for instance configure tomcat (server.xml) to use this, and it will then be available in my webapp? Is there a way to configure in the web app itself? (web.xml or something?) Stef. -Original Message- From: Hajratwala, Nayan (N.) [mailto:[EMAIL PROTECTED]] Sent: Dienstag, 15. Oktober 2002 16:42 To: 'Struts Users Mailing List' Subject: RE: How to use datasource and db connection pooling in struts? you can use commons-dbcp ... see http://jakarta.apache.org/commons/dbcp.html --- - Nayan Hajratwala - Chikli Consulting LLC - http://www.chikli.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 15, 2002 10:40 AM To: [EMAIL PROTECTED] Subject: How to use datasource and db connection pooling in struts? Hi, there! How can I easily achieve database connection pooling (using a datasource in one of the xml config files - btw. which one is it?)? I know there is some stuff in jakarta-commons. What I want to achieve is an easy to configure and highly efficient db connection pool that is available to all my action classes. Stef. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to use datasource and db connection pooling in struts?
You can specify this in your struts-config.xml file for each webapp. Dave From: [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: How to use datasource and db connection pooling in struts? Date: Tue, 15 Oct 2002 17:14:29 +0200 If I'm getting this right, I could for instance configure tomcat (server.xml) to use this, and it will then be available in my webapp? Is there a way to configure in the web app itself? (web.xml or something?) Stef. -Original Message- From: Hajratwala, Nayan (N.) [mailto:[EMAIL PROTECTED]] Sent: Dienstag, 15. Oktober 2002 16:42 To: 'Struts Users Mailing List' Subject: RE: How to use datasource and db connection pooling in struts? you can use commons-dbcp ... see http://jakarta.apache.org/commons/dbcp.html --- - Nayan Hajratwala - Chikli Consulting LLC - http://www.chikli.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 15, 2002 10:40 AM To: [EMAIL PROTECTED] Subject: How to use datasource and db connection pooling in struts? Hi, there! How can I easily achieve database connection pooling (using a datasource in one of the xml config files - btw. which one is it?)? I know there is some stuff in jakarta-commons. What I want to achieve is an easy to configure and highly efficient db connection pool that is available to all my action classes. Stef. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How to use datasource and db connection pooling in struts?
You were too fast for me ... Anyway, is it possible to define datasources for webapps NOT using struts except for using server.xml? Stef. -Original Message- From: David Graham [mailto:[EMAIL PROTECTED]] Sent: Dienstag, 15. Oktober 2002 17:00 To: [EMAIL PROTECTED] Subject: Re: How to use datasource and db connection pooling in struts? struts-config.xml is where you define your datasources. You specify the key to store the DataSource object under in the application scope so your actions can find it later. You also have to specify the DataSource implementation class to use. Often this will be provided by your database vendor but if it isn't, you can use the datasource provided by jakarta-commons dbcp BasicDataSource as suggested in a previous reply. See section 4.6.5 for configuration info: http://jakarta.apache.org/struts/userGuide/building_controller.html Dave From: [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: How to use datasource and db connection pooling in struts? Date: Tue, 15 Oct 2002 16:40:27 +0200 Hi, there! How can I easily achieve database connection pooling (using a datasource in one of the xml config files - btw. which one is it?)? I know there is some stuff in jakarta-commons. What I want to achieve is an easy to configure and highly efficient db connection pool that is available to all my action classes. Stef. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How to use datasource and db connection pooling in struts?
For that one you need to play RTFM with your server docs. It should be possible, but the way you do it would be container-dependant. Tomcat will place a reference into JNDI for you - I assume (dangerous as it is) other will too. If you are using a different server than Tomcat, and it doesn't allow you to specify a data-source in server.xml, you could always initialize a JNDI data-source in a start-up servlet -- or in a struts plugin. You could also use a singleton pattern. [EMAIL PROTECTED] wrote: You were too fast for me ... Anyway, is it possible to define datasources for webapps NOT using struts except for using server.xml? Stef. -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to use datasource and db connection pooling in struts?
Thanks for this hint. I am using tomcat 99% of the time, so it shouldn't be to bad. However I like the traditional start-up servlet method better. Happen to have any code on this (e.g. a start-up servlet...)? I know old school pooling used start-up servlets too, and then you had to leave the pool in the context. But with JNDI this should be easier. Stef. -Original Message- From: Eddie Bush [mailto:[EMAIL PROTECTED]] Sent: Dienstag, 15. Oktober 2002 17:29 To: Struts Users Mailing List Subject: Re: How to use datasource and db connection pooling in struts? For that one you need to play RTFM with your server docs. It should be possible, but the way you do it would be container-dependant. Tomcat will place a reference into JNDI for you - I assume (dangerous as it is) other will too. If you are using a different server than Tomcat, and it doesn't allow you to specify a data-source in server.xml, you could always initialize a JNDI data-source in a start-up servlet -- or in a struts plugin. You could also use a singleton pattern. [EMAIL PROTECTED] wrote: You were too fast for me ... Anyway, is it possible to define datasources for webapps NOT using struts except for using server.xml? Stef. -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[OT] Re: How to use datasource and db connection pooling in struts?
Yep, this is container dependant. Moving to OT thread... Dave From: Eddie Bush [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: How to use datasource and db connection pooling in struts? Date: Tue, 15 Oct 2002 10:29:28 -0500 For that one you need to play RTFM with your server docs. It should be possible, but the way you do it would be container-dependant. Tomcat will place a reference into JNDI for you - I assume (dangerous as it is) other will too. If you are using a different server than Tomcat, and it doesn't allow you to specify a data-source in server.xml, you could always initialize a JNDI data-source in a start-up servlet -- or in a struts plugin. You could also use a singleton pattern. [EMAIL PROTECTED] wrote: You were too fast for me ... Anyway, is it possible to define datasources for webapps NOT using struts except for using server.xml? Stef. -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How to use datasource and db connection pooling in struts?
[EMAIL PROTECTED] wrote: If I'm getting this right, I could for instance configure tomcat (server.xml) to use this, and it will then be available in my webapp? Yes. See the HOWTOs on the site. Is there a way to configure in the web app itself? (web.xml or something?) see the site docs I mentioned up ^ Someone went to the trouble of writing the HOWTO so that we could refer you there - go read it ;-) Stef. -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How to use datasource and db connection pooling in struts?
I use Tomcat 100% of the time, so, no, I don't have code to initialize the data-source. Sorry :-( A ContextListener would also be another approach I forgot to mention. That's a servlet spec 2.3 thing - and would be even further independent of the particular app. Once written, you could drop into any app to init your data-source. If you find the need to externalize your configuration, see commons-digester -- it's a snap! (read the package docs for info on how to use digester - it is well documented through the javadocs) [EMAIL PROTECTED] wrote: Thanks for this hint. I am using tomcat 99% of the time, so it shouldn't be to bad. However I like the traditional start-up servlet method better. Happen to have any code on this (e.g. a start-up servlet...)? I know old school pooling used start-up servlets too, and then you had to leave the pool in the context. But with JNDI this should be easier. Stef. -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DB Connection Pooling
What would someone recommend for using as a connection pool besides the Struts one? Basically I'm looking for a similiar product, but I want it to be able to check if a connection has been lost or gone bad and create a new one to replace the bad one. I see that there is a pool project in jakarta-commons, but it doesn't seem like it is ready yet for production use. David __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com
Re: DB Connection Pooling
David Winterfeldt wrote: What would someone recommend for using as a connection pool besides the Struts one? snip That's how I ended up an Expresso junkie. Yes, you will find a connection pool object there, but warning, you will also find a ton of other classes and features that may seem irresistable and otherwise cloud your previously clear mind. At least that's what happened to me a year ago, and I never looked back. -- Pete Carapetyan http://datafundamentals.com Java Development Services Open standards technology for commercial profitability
Re: DB Connection Pooling
David, One that appears popular here, and I'm also using is Poolman. It can be found at http://www.codestudio.com Andy - Original Message - From: David Winterfeldt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 19, 2001 4:07 PM Subject: DB Connection Pooling What would someone recommend for using as a connection pool besides the Struts one? Basically I'm looking for a similiar product, but I want it to be able to check if a connection has been lost or gone bad and create a new one to replace the bad one. I see that there is a pool project in jakarta-commons, but it doesn't seem like it is ready yet for production use. David __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com
Re: DB Connection Pooling
Thanks. This looks nice, but I'll probably just stick with the Struts one for now since the connection can refresh and I have a lot of other things to do on my project. David --- Andy Noble [EMAIL PROTECTED] wrote: David, One that appears popular here, and I'm also using is Poolman. It can be found at http://www.codestudio.com Andy - Original Message - From: David Winterfeldt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 19, 2001 4:07 PM Subject: DB Connection Pooling What would someone recommend for using as a connection pool besides the Struts one? Basically I'm looking for a similiar product, but I want it to be able to check if a connection has been lost or gone bad and create a new one to replace the bad one. I see that there is a pool project in jakarta-commons, but it doesn't seem like it is ready yet for production use. David __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com