Changeset 9874 for trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSStructureSet.java
- Timestamp:
- 2005-05-16T11:02:50+12:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSStructureSet.java
r8742 r9874 10 10 11 11 import java.sql.SQLException; 12 import java.sql.Statement; 12 13 import java.sql.ResultSet; 13 14 … … 157 158 GS3SQLWhereItem whereItem = new GS3SQLWhereItem("DocID", "=", document.getID().toString()); 158 159 select.setWhere(new GS3SQLWhere(whereItem)); 159 connection.execute(select.toString()); 160 160 161 161 // start going through the matching metadata blocks 162 162 try { 163 ResultSet resultSet = connection.getResultSet(); 164 resultSet.first(); 165 do { 166 METSStructure structure = METSStructure.readSQL(document, connection, resultSet); 167 if (structure != null) { 168 set.addStructure(structure); 169 } 170 } while (resultSet.next()); 163 Statement statement = connection.createStatement(); 164 ResultSet resultSet = statement.executeQuery(select.toString()); 165 if (resultSet.first()) { 166 do { 167 METSStructure structure = METSStructure.readSQL(document, connection, resultSet); 168 if (structure != null) { 169 set.addStructure(structure); 170 } 171 } while (resultSet.next()); 172 } 173 statement.close(); 171 174 } 172 175 catch (SQLException sqlEx) { 173 System. out.println(sqlEx);176 System.err.println("METSStructureSet.readSQL(): "+sqlEx); 174 177 System.exit(1); 175 178 }
Note:
See TracChangeset
for help on using the changeset viewer.