public void afterPropertiesSet() throws Exception {
if (this.dataSource == null) {
throw new IllegalArgumentException("dataSource should not be null");
}
if (statements == null) {
statements = new Statements();
statements.setStoreTableName(tableName);
}
Connection connection = null;
boolean restoreAutoCommit = false;
try {
connection = getDataSource().getConnection();
if (connection.getAutoCommit()) {
connection.setAutoCommit(false);
restoreAutoCommit = true;
}
adapter = JDBCAdapterFactory.getAdapter(connection);
if (statements == null) {
statements = new Statements();
statements.setStoreTableName(tableName);
}
adapter.setStatements(statements);
if (createDataBase) {
adapter.doCreateTables(connection);