cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mariusz Sieraczkiewicz <mariusz-sieraczkiew...@o2.pl>
Subject Re: How to obtain db connection from pool ?
Date Mon, 15 Dec 2003 00:26:03 GMT
Suggested using flowscript, then try sth like this:

     try {
         var dbSelector = 
cocoon.getComponent(Packages.org.apache.avalon.excalibur.datasource.DataSourceComponent.ROLE

+ "Selector");
         var dataSrc = dbSelector.select("your counnection");
         conn = dataSrc.getConnection();

	  // your stuff
     }
     catch (e) {
         e.toString();
     }
     finally {
         if (conn != null) {
             conn.close();
             conn = null;
         }

         if (dbSelector != null) {
             cocoon.releaseComponent(dbSelector);
             dbSelector = null;
         }
     }

But if you write Avalon Component, just look at database actions sources.

Regards

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message