cp30--Creating a connection pool object datasource using the configuration file properties

Source: Internet
Author: User

Creating a connection pool object datasource using the configuration file properties

As follows:

1  Public classCp30util {2     Private StaticDataSource DataSource;3     //use static blocks of code so that the driver is loaded when the tool class is invoked and loaded only once4     Static {5         Try {6             //Create DataSource Connection pool objects using the factory method "using the Datasouces factory class"7Datasource=Datasources.pooleddatasource (Datasources.unpooleddatasource ());8}Catch(Exception e) {9 e.printstacktrace ();Ten         } One}
1 /* 2 Note: CP30 in the properties have the specified format, according to the requirements of the configuration file created, unordered in the program in the loading of files, will automatically load, see friends chain: http://haoran-10.iteye.com/blog/1753332 3 */

cp30--Creating a connection pool object datasource using the configuration file properties

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.