use of io.shardingjdbc.core.jdbc.core.connection.ShardingConnection in project sharding-jdbc by shardingjdbc.
the class UnsupportedOperationStatementTest method init.
@Before
public void init() {
ShardingConnection connection = getShardingDataSource().getConnection();
shardingConnections.add(connection);
statements.add(connection.createStatement());
}
use of io.shardingjdbc.core.jdbc.core.connection.ShardingConnection in project sharding-jdbc by shardingjdbc.
the class UnsupportedUpdateOperationResultSetTest method init.
@Before
public void init() throws SQLException {
ShardingConnection shardingConnection = getShardingDataSource().getConnection();
shardingConnections.add(shardingConnection);
Statement statement = shardingConnection.createStatement();
statements.add(statement);
ResultSet resultSet = statement.executeQuery(JDBCTestSQL.SELECT_ORDER_BY_USER_ID_SQL);
resultSets.add(resultSet);
}
use of io.shardingjdbc.core.jdbc.core.connection.ShardingConnection in project sharding-jdbc by shardingjdbc.
the class ConnectionAdapterTest method assertClose.
@Test
public void assertClose() throws SQLException {
try (ShardingConnection actual = getShardingDataSource().getConnection()) {
actual.createStatement().executeQuery(sql);
assertClose(actual, false);
actual.close();
assertClose(actual, true);
}
}
use of io.shardingjdbc.core.jdbc.core.connection.ShardingConnection in project sharding-jdbc by shardingjdbc.
the class ConnectionAdapterTest method assertClose.
private void assertClose(final ShardingConnection actual, final boolean closed) throws SQLException {
assertThat(actual.isClosed(), is(closed));
assertThat(actual.getCachedConnections().size(), is(2));
for (Connection each : actual.getCachedConnections().values()) {
assertThat(each.isClosed(), is(closed));
}
}
use of io.shardingjdbc.core.jdbc.core.connection.ShardingConnection in project sharding-jdbc by shardingjdbc.
the class ResultSetAdapterTest method init.
@Before
public void init() throws SQLException {
ShardingConnection shardingConnection = getShardingDataSource().getConnection();
shardingConnections.add(shardingConnection);
Statement statement = shardingConnection.createStatement();
statements.add(statement);
resultSets.put(getCurrentDatabaseType(), statement.executeQuery(JDBCTestSQL.SELECT_GROUP_BY_USER_ID_SQL));
}
Aggregations