[opencms-dev] Accessing mysql-dbms from opencms

Andre Bernardini mail at andre-bernardini.de
Wed Nov 10 11:32:04 CET 2004


First, thanks for your solution.

Are these XML content definitions already available in opencms5?

If so - do you know any webresources that deal with xml content definitions? If
that is THE way of doing it, I would like to read about it.

so long...
André Bernardini

The OpenCms mailing list <opencms-dev at opencms.org> wrote: 
> Andre Bernardini schrieb:
> > Hello again,
> > 
> > I'm trying to build a module and need to directly access the dbms to store
> > information on customly created tables.
> >
> > So far I tried "Connection con =
> > DriverManager.getConnection("URL","username","password");" in one of my
JSPs.
> 
> OpenCms uses jakarta commons DBCP. Thus, you can fetch a connection from
> the connection pool:
> 
> Connection con=
>      DriverManager.getConnection(
>          CmsDbPool.C_DBCP_JDBC_URL_PREFIX
>        + CmsDbPool.C_OPENCMS_DEFAULT_POOL_URL);
> 
> Note: I don't know if this is *the* way to get a connection. I found
> this out by reading the source plus try-and-error and so far it seems to
> work fine.
> 
> I understand that creating additional DB tables is discouraged in favor
> of creating XML content definitions (which is a great feature, by the
> way) but I think in some cases you simply don't want to do without SQL.
> 
> 
> Regards,
> Robert
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
> 
> 




More information about the opencms-dev mailing list