public static void main(String [] args) throws Exception {
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 {