Example #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);
  }
Example #2
0
 private static void dropIndexSQLServer(Connection connection, String tableName, String indexName)
     throws SQLException {
   DatabaseVendor vendor = connection.vendor();
   String sql = "drop index " + vendor.quote(tableName) + "." + vendor.quote(indexName);
   Statement.executeUpdate(connection, sql);
 }
Example #3
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);
 }