Esempio n. 1
0
  void run(Connection connection) throws SQLException {
    Database database = connection.database();
    DatabaseVendor vendor = database.vendor();

    String sql =
        "CREATE "
            + (unique ? "UNIQUE " : "")
            + "INDEX "
            + vendor.quote((unique ? "UNQ_" : "IDX_") + table.name() + "_" + id)
            + " "
            + "ON "
            + database.tableName(table.name())
            + "("
            + formatIndexFields(vendor)
            + ")"
            + getTableSpace(connection);

    Statement.executeUpdate(connection, sql);
  }
Esempio n. 2
0
 private static void dropIndexOracle(Connection connection, String tableName, String indexName)
     throws SQLException {
   Database database = connection.database();
   String sql = "drop index " + database.tableName(indexName);
   Statement.executeUpdate(connection, sql);
 }