use of io.shardingjdbc.core.jdbc.core.connection.ShardingConnection in project sharding-jdbc by shardingjdbc.
the class StatementAdapterTest method init.
@Before
public void init() {
ShardingConnection shardingConnection = getShardingDataSource().getConnection();
shardingConnections.add(shardingConnection);
statements.put(getCurrentDatabaseType(), shardingConnection.createStatement());
}
use of io.shardingjdbc.core.jdbc.core.connection.ShardingConnection in project sharding-jdbc by shardingjdbc.
the class UnsupportedOperationPreparedStatementTest method init.
@Before
public void init() {
ShardingConnection shardingConnection = getShardingDataSource().getConnection();
shardingConnections.add(shardingConnection);
PreparedStatement preparedStatement = shardingConnection.prepareStatement(DatabaseTestSQL.SELECT_WITH_ALIAS_SQL);
statements.add(preparedStatement);
}
use of io.shardingjdbc.core.jdbc.core.connection.ShardingConnection in project sharding-jdbc by shardingjdbc.
the class UnsupportedOperationResultSetTest method init.
@Before
public void init() throws SQLException {
ShardingConnection connection = getShardingDataSource().getConnection();
shardingConnections.add(connection);
Statement statement = connection.createStatement();
statements.add(statement);
resultSets.add(statement.executeQuery(sql));
}
use of io.shardingjdbc.core.jdbc.core.connection.ShardingConnection in project sharding-jdbc by shardingjdbc.
the class ConnectionAdapterTest method assertSetTransactionIsolation.
@Test
public void assertSetTransactionIsolation() throws SQLException {
try (ShardingConnection actual = getShardingDataSource().getConnection()) {
assertThat(actual.getTransactionIsolation(), is(Connection.TRANSACTION_READ_UNCOMMITTED));
actual.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
actual.createStatement().executeQuery(sql);
assertTransactionIsolation(actual, Connection.TRANSACTION_SERIALIZABLE);
if (DatabaseType.Oracle != getCurrentDatabaseType()) {
actual.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
assertTransactionIsolation(actual, Connection.TRANSACTION_READ_COMMITTED);
}
}
}
use of io.shardingjdbc.core.jdbc.core.connection.ShardingConnection in project sharding-jdbc by shardingjdbc.
the class ConnectionAdapterTest method assertSetHoldability.
@Test
public void assertSetHoldability() throws SQLException {
try (ShardingConnection actual = getShardingDataSource().getConnection()) {
actual.setHoldability(ResultSet.CONCUR_READ_ONLY);
assertThat(actual.getHoldability(), is(ResultSet.CLOSE_CURSORS_AT_COMMIT));
}
}
Aggregations