[opencms-dev] need SQL connection example

Christoph P. Kukulies kuku at physik.rwth-aachen.de
Fri Feb 29 12:15:03 CET 2008


On Fri, Feb 29, 2008 at 10:47:40AM +0100, Jordi Mart? wrote:
> You can get the java.sql connection that opencms provides through this
> sentence:
> 
> java.sql.Connection con =
> org.opencms.main.OpenCms.getSqlManager().getConnection(org.opencms.db.CmsDbP
> ool.getDefaultDbPoolName());

I'm not so familar with CmsSqlManager class.
Assumed I have a second database besides opencms, e.g. "accounting".
Would it allow me to switch the database to "accounting" ? Or would it
require to add another connection pool as Arash pointed me to?


> 
> You can use it directly in your jsp or in whatever servlet or class you
> would like to use.
> 
> It's a good practice to create your jsp inside a module in opencms.
>    
--
Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de



More information about the opencms-dev mailing list