struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Leja" <>
Subject statement pooling, howto utilize in struts
Date Wed, 26 Mar 2003 11:19:57 GMT

the struts docs suggest the usage of org.apache.commons.dbcp.BasicDataSource
as data-source which supports connection pooling.

I am also interested in statement pooling support, but i didn't find any
useful hints about it. Commons/dbcp only provides examples and api docs
which i cannot learn from if BasicDataSource supports statement pooling.
Searching the struts user mailing list archive didn't help neither.

I then came across the jdbc 3.0 api specification at
In this document it's described how a data-source implementaion can be
tested whether it supports the wanted feature.

I gave it a try, configured a mysql/BasicDataSource in struts-config.xml and
run the following action:
public ActionForward execute(
  ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response
  throws Exception
    javax.sql.DataSource dat;
    java.sql.Connection con= null;
    try {
      dat= getDataSource(request);
      con= dat.getConnection();

      java.sql.DatabaseMetaData meta= con.getMetaData();
      System.out.println( "supportsStatementPooling: "
        + meta.supportsStatementPooling() );
    } catch (java.sql.SQLException sqle) {
      getServlet().log("Connection.process", sqle);
    } finally {
      try {
      } catch (java.sql.SQLException e) {
        getServlet().log("Connection.close", e);
  return ( mapping.findForward("welcome") );

meta.supportsStatementPooling() returns false in this case. Is there a
data-source implementaion which supports this feature and works with struts?
I believe that there is to litte info on this subject. Can someone point me
to the right location where i can read more about it?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message