The accepted practice is to configure your connection pool just as you would for any other J2EE application and to not have any ties to Struts (though there once was a practice of declaring a "Struts" data source). Just declare your data source in web.xml, configure it in your Tomcat context XML file (or, I think, globally in server.xml) and look up the data source via JNDI (javax.naming.InitialContext.lookup) in your Java code. So you don't necessarily need a Struts-specific tutorial but rather a good J2EE/JDBC tutorial. Typically the documentation that comes with your server will suffice. I have found that the Tomcat and JBoss docs do a decent, if not stellar, job of this (speaking of Tomcat 5 and JBoss 3). You can also learn some things from the WebLogic documentation even if you aren't using WebLogic, as it is generally much further along, and, these days, spec compliance among servers tends to be pretty good.

I think DBCP is commonly used with Struts, but I have to be honest with you. I've never gotten it to work correctly with Oracle or SQL Server 2000 (the pools always leak and connections are "burned up" eventually). But I have had success using it with MySQL. I know I'm not the only one who has had problems with DBCP and Oracle on this list, but maybe someone who has had some luck with it might post an example Tomcat context file with his working DBCP/Oracle config.

Also a lot of Struts users also use persistence frameworks instead, such as Hibernate and iBatis.

Erik



Kevin Bridges wrote:

Hi.  I am completely new at struts and fairly new to java ... so if
these questions are blatantly ignorant please be kind. If this email
is out of scope for this list, please notify me off-list.

I am interested in setting up database pooling for struts and have
been following a tutorial located at
http://www.arc-mind.com/chapters/strutsTut.pdf (p.27), which outlines
a process for doing so.

The tutorial makes reference to a struts-legacy.jar that ships with
Struts 1.1 along with commons-dbcp.jar and commons-pool.jar.  The
tutorial is completely written for Struts 1.1

I'm using Struts 1.2.4 on Tomcat 4.1 ... Should I continue to follow
the tutorials 1.1 path, or is there a better approach I can utilize
for Struts 1.2.4?  Any pointers to tutorials or additional reference
material is greatly appreciated.

Thanks.
Kevin Bridges

---------------------------------------------------------------------
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]



Reply via email to