implement useCompression on jdbc connect

This commit is contained in:
servertude
2008-03-15 03:06:17 +00:00
parent 2c42f69038
commit 73b6e59280
2 changed files with 8 additions and 0 deletions

View File

@ -13,6 +13,10 @@ try
MysqlDataSource ds = new MysqlDataSource(); MysqlDataSource ds = new MysqlDataSource();
String url = "jdbc:mysql://" + profile.get("host") + ":" + profile.get("port") + "/"; String url = "jdbc:mysql://" + profile.get("host") + ":" + profile.get("port") + "/";
if ( "true".equals(profile.get("compress")) )
{
url+="?useCompression=true";
}
ds.setUrl(url); ds.setUrl(url);
ds.setUser(profile.get("user")); ds.setUser(profile.get("user"));
ds.setPassword(profile.get("password")); ds.setPassword(profile.get("password"));

View File

@ -12,6 +12,10 @@ try
MysqlDataSource ds = new MysqlDataSource(); MysqlDataSource ds = new MysqlDataSource();
String url = "jdbc:mysql://" + profile.get("host") + ":" + profile.get("port") + "/"; String url = "jdbc:mysql://" + profile.get("host") + ":" + profile.get("port") + "/";
if ( "true".equals(profile.get("compress")) )
{
url+="?useCompression=true";
}
ds.setUrl(url); ds.setUrl(url);
ds.setUser(profile.get("user")); ds.setUser(profile.get("user"));
ds.setPassword(profile.get("password")); ds.setPassword(profile.get("password"));