private void runAgainstDerby(List<String> queries) throws Exception {
    Connection conn = null;
    Statement stmt = null;
    ResultSet rs = null;

    try {
      conn = TestTxnDbUtil.getConnection(conf);
      stmt = conn.createStatement();
      for (String query : queries) {
        rs = stmt.executeQuery(query);
        Assert.assertTrue("The query is not valid", rs.next());
      }
    } finally {
      TestTxnDbUtil.closeResources(conn, stmt, rs);
    }
  }
Verify queries can run against Derby DB.
 As long as Derby doesn't complain, we assume the query is syntactically/semantically correct.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/txn/TestTxnUtils.java