@Test
  public void testPrepareSetTimestamp() throws SQLException, ParseException {
    String sql = String.format("SELECT * FROM %s WHERE c17 = ?", dataTypeTableName);
    try (PreparedStatement ps = con.prepareStatement(sql)) {
      Timestamp timestamp = Timestamp.valueOf("2012-04-22 09:00:00.123456789");
      ps.setTimestamp(1, timestamp);
      // Ensure we find the single row which matches our timestamp (where field 1 has value 1)
      try (ResultSet resultSet = ps.executeQuery()) {
        assertTrue(resultSet.next());
        assertEquals(1, resultSet.getInt(1));
        assertFalse(resultSet.next());
      }
    }
  }
Test getting query log when HS2 disable logging.

@throws Exception
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java