Obtain the database connection pool of opencms

Source: Internet
Author: User

See some netizens asked "can you modify the table structure of opencms, after modification how to access", the answer is "yes", opencms has its own database connection pool, in/WEB-INF/config/opencms. in the properties file, the default database connection pool name is "default". You can add your own tables to the opencms database and obtain the "database connection pool" using the following methods ":

<% @ Page import = "Java. SQL. *, org. opencms. DB. *, org. opencms. Main. *" %>
<%
Java. SQL. Connection conn = opencms. getsqlmanager (). getconnection ("default ");
// Your code
Conn. Close ();
%>

However, it seems that this may violate the original intention of opencms, but return to the "original" development mode. It is best not to use this method to solve problems that can be solved by using opencms custom types and APIs.
In the next article, we will summarize the methods of opencms custom types, hoping to help you ......
(Thank you for choosing opencms, the first blog of Chinese resources, http://blog.csdn.net/qianxuncms/. we welcome you to communicate directly with the author and make progress together. MSN: qianxuncms@hotmail.com, QQ: 9165456)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.