use of org.apache.calcite.avatica.Meta.Signature in project calcite-avatica by apache.
the class AvaticaClosedPreparedStatementTest method newInstance.
@Override
protected PreparedStatement newInstance() throws Exception {
UnregisteredDriver driver = new TestDriver();
AvaticaConnection connection = new AvaticaConnection(driver, driver.createFactory(), "jdbc:avatica", new Properties()) {
};
StatementHandle handle = mock(StatementHandle.class);
Signature signature = new Signature(Collections.emptyList(), "", Collections.emptyList(), Collections.emptyMap(), null, Meta.StatementType.SELECT);
AvaticaPreparedStatement preparedStatement = new AvaticaPreparedStatement(connection, handle, signature, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT) {
};
preparedStatement.close();
assertTrue("Prepared statement is not closed", preparedStatement.isClosed());
return preparedStatement;
}
use of org.apache.calcite.avatica.Meta.Signature in project calcite-avatica by apache.
the class AvaticaClosedResultSetTest method newInstance.
@Override
protected ResultSet newInstance() throws Exception {
UnregisteredDriver driver = new TestDriver();
AvaticaConnection connection = new AvaticaConnection(driver, driver.createFactory(), "jdbc:avatica", new Properties()) {
};
StatementHandle handle = mock(StatementHandle.class);
AvaticaStatement statement = new AvaticaStatement(connection, handle, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT) {
};
Signature signature = new Signature(Collections.emptyList(), "", Collections.emptyList(), Collections.emptyMap(), null, Meta.StatementType.SELECT);
AvaticaResultSet resultSet = new AvaticaResultSet(statement, new QueryState(""), signature, null, DateTimeUtils.UTC_ZONE, null);
resultSet.close();
assertTrue("Resultset is not closed", resultSet.isClosed());
return resultSet;
}
Aggregations