code: private static boolean tableExists(CallInfo callInfo, DB db, String tableName) {
      return db.access(callInfo, () -> { 
        DatabaseMetaData dbmd = db.getConnection().getMetaData();
        try(ResultSet rs = dbmd.getTables(null, null, null, new String[] {"TABLE"})) {
          while(rs.next()) { 
            if (tableName.equalsIgnoreCase(rs.getString("TABLE_NAME"))) {
              return true;
            }
          }
        }
        return false;
      });
    }
docs: Check if table exists.
  @param callInfo Call info.
  @param db Database.
  @param tableName Table name.
  @return <code>true<code> if and only if the table exists.