ConnectionManager connectionManager = new DBCPConnectionPool(newDBCPDataSource());
// ConnectionManager connectionManager = new SingleConnectionManager("com.mysql.jdbc.Driver", "jdbc:mysql://localhost:3306/bookdb?", "root", "");
Adapter adapter = new JDBCAdapter(connectionManager);
EhcacheManager cacheManager = new EhcacheManager(newEhcacheManager());
Provider provider = new MySQLProvider(adapter, cacheManager);
DB db = DBFactory.register(new DB(provider));
// testing
DBConnection connection = db.getConnection();
try {
test1();
test2();
test3();
test4();
test5();
test6();
test7();
test8();
test9();
test10();
test11();
} finally {
db.closeConnection(connection);
db.getCacheManager().shutdown();
}
}