Created
July 19, 2013 09:32
-
-
Save akandratovich/6037925 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
driverClass=com.mysql.jdbc.Driver | |
jdbcUrl=jdbc:mysql://192.168.222.3:13306/channelplace20130227?autoReconnect=true&characterEncoding=utf-8&useUnicode=true | |
username=social | |
password=social | |
partitionCount=4 | |
maxConnectionsPerPartition=8 | |
minConnectionsPerPartition=2 | |
acquireIncrement=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
private static BoneCPDataSource initialize() { | |
PropertyResourceBundle config = (PropertyResourceBundle) ResourceBundle.getBundle("bonecp"); | |
Properties p = new Properties(); | |
Enumeration<String> keys = config.getKeys(); | |
while (keys.hasMoreElements()) { | |
String key = keys.nextElement(); | |
p.setProperty(key, config.getString(key)); | |
} | |
BoneCPDataSource ds = new BoneCPDataSource(); | |
try { | |
Class.forName("com.mysql.jdbc.Driver"); | |
ds.setProperties(p); | |
ds.setDriverProperties(p); | |
ds.sanitize(); | |
} catch (Exception e) { | |
logger.error("Could not initialize datasource", e); | |
} | |
return ds; | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment