Ignore:
Timestamp:
2005-05-16T11:02:50+12:00 (19 years ago)
Author:
kjdon
Message:

merged from branch ant-install-branch: merge 1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSDescriptiveSet.java

    r8742 r9874  
    99
    1010import java.sql.SQLException;
     11import java.sql.Statement;
    1112import java.sql.ResultSet;
    1213
     
    236237    GS3SQLWhereItem whereItem = new GS3SQLWhereItem("DocID", "=", document.getID().toString());
    237238    select.setWhere(new GS3SQLWhere(whereItem));
    238     connection.execute(select.toString());
    239    
     239
    240240    // start going through the matching metadata blocks
    241241    try {
    242         ResultSet resultSet = connection.getResultSet();
    243         resultSet.first();
    244         do {
    245         METSDescriptive descriptive = METSDescriptive.readSQL(document, connection, resultSet);
    246         if (descriptive != null) {
    247             set.addDescriptive(descriptive);
    248         }
    249         else {
    250             System.out.println("Null descriptive");
    251         }
    252         } while (resultSet.next());
     242        Statement statement = connection.createStatement();
     243        ResultSet resultSet = statement.executeQuery(select.toString());
     244        if (resultSet.first()) {
     245        do {
     246            METSDescriptive descriptive = METSDescriptive.readSQL(document, connection, resultSet);
     247            if (descriptive != null) {
     248            set.addDescriptive(descriptive);
     249            }
     250            else {
     251            System.out.println("Null descriptive");
     252            }
     253        } while (resultSet.next());
     254        }
     255        statement.close();
    253256    }
    254257    catch (SQLException sqlEx) {
    255         System.out.println(sqlEx);
     258        System.err.println("METSDescriptiveSet.readSQL(): "+sqlEx);
    256259        System.exit(1);
    257260    }
    258261   
     262   
    259263    return set;
    260264    }
Note: See TracChangeset for help on using the changeset viewer.