The connection pool was removed directly from the jive and modified to allow the connection parameters to be read directly in the program rather than in the subordinate file.
Usage: First set your own connection parameters, in the Dbconnectiondefaultpool.java file Loadproperties method. Note that you also need to set the location of the log file for the connection pool.
String driver= "Org.gjt.mm.mysql.Driver";//This is the JDBC driver used
String server= "Jdbc:mysql://192.100.100.1/qingtuo";/the URL used
String server= "Jdbc:mysql://192.168.0.1/qingtuo";
String username= "Qingtuo";
String password= "Qingtuo";
String minconnections= "3";//minimum number of connections
String maxconnections= "20";//maximum number of connections
String logpath= "C:\\temp\\qingtuodblog.log";//log file location
String logpath= "/tmp/qingtuodblog.log";
String connectiontimeout= "0.5";//timed purge unwanted connection interval (in days)
and then In your program you just need to import the package Com.qingtuo.db.pool, and then use the following.
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.