use of org.infinispan.persistence.jdbc.impl.table.TableName in project infinispan by infinispan.
the class TableManagerTest method testDrop.
@Test(dependsOnMethods = "testExists")
public void testDrop() throws Exception {
TableName dataTableName = tableManager.getDataTableName();
TableName metaTableName = tableManager.getMetaTableName();
assert tableManager.tableExists(connection, dataTableName);
assert tableManager.tableExists(connection, metaTableName);
byte[] data = new byte[64];
new Random().nextBytes(data);
PreparedStatement ps = null;
try {
ps = connection.prepareStatement("INSERT INTO " + tableManager.getDataTableName() + "(ID_COLUMN, DATA_COLUMN, TIMESTAMP_COLUMN, SEGMENT_COLUMN) values(?, ?, ?, ?)");
ps.setString(1, System.currentTimeMillis() + "");
ps.setBytes(2, data);
ps.setLong(3, System.currentTimeMillis());
ps.setLong(4, 1);
assert 1 == ps.executeUpdate();
} finally {
org.infinispan.persistence.jdbc.common.JdbcUtil.safeClose(ps);
}
tableManager.dropTables(connection);
assert !tableManager.tableExists(connection, dataTableName);
assert !tableManager.tableExists(connection, metaTableName);
}
use of org.infinispan.persistence.jdbc.impl.table.TableName in project infinispan by infinispan.
the class TableManagerTest method testTableQuoting.
public void testTableQuoting() throws Exception {
TableName dataTableName = tableManager.getDataTableName();
tableManager.dropDataTable(connection);
assert !existsTable(connection, dataTableName);
tableManager.createDataTable(connection);
assert existsTable(connection, tableManager.getDataTableName());
}
Aggregations