Revision 6595
Added by ben leinfelder over 12 years ago
IndexingQueue.java | ||
---|---|---|
216 | 216 |
boolean inxmldoc = false; |
217 | 217 |
|
218 | 218 |
String revision = docid.substring(docid.lastIndexOf(".")+1,docid.length()); |
219 |
int rev = Integer.parseInt(revision); |
|
219 | 220 |
docid = docid.substring(0,docid.lastIndexOf(".")); |
220 | 221 |
|
221 | 222 |
logMetacat.info("Checking if document exists in xml_documents: docid is " |
... | ... | |
228 | 229 |
serialNumber = dbConn.getCheckOutSerialNumber(); |
229 | 230 |
|
230 | 231 |
String xmlDocumentsCheck = "SELECT distinct docid FROM " + tablename |
231 |
+ " WHERE docid ='" + docid
|
|
232 |
+ "' AND rev ='" + revision + "'";
|
|
232 |
+ " WHERE docid = ? "
|
|
233 |
+ " AND rev = ?";
|
|
233 | 234 |
|
234 | 235 |
PreparedStatement xmlDocCheck = dbConn.prepareStatement(xmlDocumentsCheck); |
236 |
xmlDocCheck.setString(1, docid); |
|
237 |
xmlDocCheck.setInt(2, rev); |
|
235 | 238 |
// Increase usage count |
236 |
|
|
237 | 239 |
dbConn.increaseUsageCount(1); |
238 | 240 |
xmlDocCheck.execute(); |
239 | 241 |
ResultSet doccheckRS = xmlDocCheck.getResultSet(); |
Also available in: Unified diff
http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5527