HiveJdbcConnectionDelegate implements ConnectionDelegate { @Override public HiveStatement createStatement(HiveConnection connection) throws SQLException { Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); currentStatement = (HiveStatement) statement; return currentStatement; }  @Override HiveStatement createStatement(HiveConnection connection); @Override Optional<ResultSet> execute(String statement); @Override Optional<ResultSet> execute(HiveConnection connection, String sqlStatement); @Override ResultSet getColumnMetadata(HiveConnection connection, GetColumnMetadataJob job); @Override void cancel(); @Override void closeResultSet(); @Override void closeStatement();  }
@Test public void testCreateStatement() throws SQLException { HiveConnection hiveConnection = createNiceMock(HiveConnection.class); HiveStatement hiveStatement = createNiceMock(HiveStatement.class); expect(hiveConnection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY)).andReturn(hiveStatement); replay(hiveConnection); HiveStatement statement = new HiveJdbcConnectionDelegate().createStatement(hiveConnection); assertEquals(hiveStatement, statement); }