package com.dbcon;
public class DBConfigXML {
public static final String JDBCDriver="com.mysql.jdbc.Driver";
public static final String JDBCURL="jdbc:mysql://localhost:3306/test";
public static final String JDBCUsername="fly";
public static final String JDBCPassword="123456";
//init connection count
public static final int initCount=10;
//连接池不足的时候增长的步进值
public static final int step=10;
//max pool conneciton
public static final int maxCount=10;
}
package com.dbcon; public class DBConfigXML { public static final String JDBCDriver="com.mysql.jdbc.Driver"; public static final String JDBCURL="jdbc:mysql://localhost:3306/test"; public static final String JDBCUsername="fly"; public static final String JDBCPassword="123456"; //init connection count public static final int initCount=10; //连接池不足的时候增长的步进值 public static final int step=10; //max pool conneciton public static final int maxCount=10; }
package com.dbcon;
import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement;
public class MyPooledConnection {
}
package com.dbcon;
public interface FMyPool { public MyPooledConnection getMyPoolConnection(); public void createMyPooledConnection(int count); }
package com.dbcon;
import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Vector;
public class FMyDefaultPool implements FMyPool {
}
package com.dbcon;
public class FMyPoolFactory { public static class CreatePool{ public static FMyPool mypool=new FMyDefaultPool(); }
}
package com.dbcon;
import java.sql.ResultSet; import java.sql.SQLException;
public class TestPool { public static FMyPool fMyPool = FMyPoolFactory.getInstance();
}