Revision 9492
Added by Jing Tao over 8 years ago
DBEntityResolver.java | ||
---|---|---|
220 | 220 |
PreparedStatement pstmt = null; |
221 | 221 |
DBConnection conn = null; |
222 | 222 |
int serialNumber = -1; |
223 |
ResultSet rs = null; |
|
223 | 224 |
try { |
224 | 225 |
//check out DBConnection |
225 | 226 |
conn=DBConnectionPool.getDBConnection("DBEntityResolver.getDTDSystemID"); |
... | ... | |
232 | 233 |
pstmt.setString(1, doctype); |
233 | 234 |
|
234 | 235 |
pstmt.execute(); |
235 |
ResultSet rs = pstmt.getResultSet();
|
|
236 |
rs = pstmt.getResultSet(); |
|
236 | 237 |
boolean tableHasRows = rs.next(); |
237 | 238 |
if (tableHasRows) { |
238 | 239 |
systemid = rs.getString(1); |
... | ... | |
241 | 242 |
systemid = SystemUtil.getContextURL() + systemid; |
242 | 243 |
} |
243 | 244 |
} |
244 |
pstmt.close(); |
|
245 |
//pstmt.close();
|
|
245 | 246 |
} catch (SQLException e) { |
246 | 247 |
throw new SAXException |
247 | 248 |
("DBEntityResolver.getDTDSystemID - SQL error when getting DTD system ID: " + e.getMessage()); |
... | ... | |
253 | 254 |
{ |
254 | 255 |
try |
255 | 256 |
{ |
256 |
pstmt.close(); |
|
257 |
if(rs != null) { |
|
258 |
rs.close(); |
|
259 |
} |
|
260 |
if(pstmt != null) { |
|
261 |
pstmt.close(); |
|
262 |
} |
|
263 |
|
|
257 | 264 |
}//try |
258 | 265 |
catch (SQLException sqlE) |
259 | 266 |
{ |
Also available in: Unified diff
Make sure to close the prepared statement on the final statement.