private void createNewIndexEntry(String indexName) throws SQLException {
  ResultSet rs;
  String unique="";
  String tableName="";
  rs=stmtdb2.executeQuery("select table_name, uniqueness from user_indexes where index_name='" + indexName + "'");
  if (rs.next()) {
    tableName=rs.getString("TABLE_NAME");
    unique=rs.getString("UNIQUENESS");
    if (unique.equals("NONUNIQUE")) {
      unique="";
    }
  }
  rs.close();
  String createStatement="CREATE " + unique + " INDEX "+ indexName+ " ON "+ tableName+ " (";
  rs=stmtdb2.executeQuery("select column_name from user_ind_columns where index_name='" + indexName + "' order by column_position");
  int k=0;
  while (rs.next()) {
    if (k != 0) {
      createStatement+=" ,";
    }
    createStatement+=rs.getString("COLUMN_NAME");
    k++;
  }
  rs.close();
  createStatement+=");";
  m_newIndexStatements.add(createStatement);
}

private void createNewIndexEntry ( String indexName ) throws SQLException { ResultSet rs ; String unique = "" ; String tableName = "" ; rs = stmtdb2 . executeQuery ( "select table_name, uniqueness from user_indexes where index_name='" + indexName + "'" ) ; if ( rs . next ( ) ) { tableName = rs . getString ( "TABLE_NAME" ) ; unique = rs . getString ( "UNIQUENESS" ) ; if ( unique . equals ( "NONUNIQUE" ) ) { unique = "" ; } } rs . close ( ) ; String createStatement = "CREATE " + unique + " INDEX " + indexName + " ON " + tableName + " (" ; rs = stmtdb2 . executeQuery ( "select column_name from user_ind_columns where index_name='" + indexName + "' order by column_position" ) ; int k = 0 ; while ( rs . next ( ) ) { if ( k != 0 ) { createStatement += " ," ; } createStatement += rs . getString ( "COLUMN_NAME" ) ; k ++ ; } rs . close ( ) ; createStatement += ");" ; m_newIndexStatements . add ( createStatement ) ; }
creates create index statements for the giving indexname and adds them to the global m_newindexstatements vector .
