Search in sources :

Example 1 with JdbcConfig

use of com.scalar.db.storage.jdbc.JdbcConfig in project scalardb by scalar-labs.

the class JdbcTransactionIntegrationTest method setUpBeforeClass.

@BeforeClass
public static void setUpBeforeClass() throws ExecutionException {
    DatabaseConfig databaseConfig = TestUtils.addSuffix(JdbcEnv.getJdbcConfig(), TEST_NAME);
    JdbcConfig config = new JdbcConfig(databaseConfig.getProperties());
    StorageFactory factory = new StorageFactory(config);
    admin = factory.getAdmin();
    admin.createNamespace(NAMESPACE, true);
    admin.createTable(NAMESPACE, TABLE, TableMetadata.newBuilder().addColumn(ACCOUNT_ID, DataType.INT).addColumn(ACCOUNT_TYPE, DataType.INT).addColumn(BALANCE, DataType.INT).addPartitionKey(ACCOUNT_ID).addClusteringKey(ACCOUNT_TYPE).build(), true);
    manager = new JdbcTransactionManager(config);
}
Also used : StorageFactory(com.scalar.db.service.StorageFactory) JdbcConfig(com.scalar.db.storage.jdbc.JdbcConfig) DatabaseConfig(com.scalar.db.config.DatabaseConfig) BeforeClass(org.junit.BeforeClass)

Aggregations

DatabaseConfig (com.scalar.db.config.DatabaseConfig)1 StorageFactory (com.scalar.db.service.StorageFactory)1 JdbcConfig (com.scalar.db.storage.jdbc.JdbcConfig)1 BeforeClass (org.junit.BeforeClass)1