use of org.parosproxy.paros.db.RecordScan in project zaproxy by zaproxy.
the class SqlTableScan method read.
/* (non-Javadoc)
* @see org.parosproxy.paros.db.paros.TableScan#read(int)
*/
@Override
public synchronized RecordScan read(int scanId) throws DatabaseException {
SqlPreparedStatementWrapper psRead = null;
try {
psRead = DbSQL.getSingleton().getPreparedStatement("scan.ps.read");
psRead.getPs().setInt(1, scanId);
try (ResultSet rs = psRead.getPs().executeQuery()) {
RecordScan result = build(rs);
return result;
}
} catch (SQLException e) {
throw new DatabaseException(e);
} finally {
DbSQL.getSingleton().releasePreparedStatement(psRead);
}
}
use of org.parosproxy.paros.db.RecordScan in project zaproxy by zaproxy.
the class ParosTableScan method build.
private RecordScan build(ResultSet rs) throws DatabaseException {
try {
RecordScan scan = null;
if (rs.next()) {
scan = new RecordScan(rs.getInt(SCANID), rs.getString(SCANNAME), rs.getDate(SCANTIME));
}
rs.close();
return scan;
} catch (SQLException e) {
throw new DatabaseException(e);
}
}
use of org.parosproxy.paros.db.RecordScan in project zaproxy by zaproxy.
the class SqlTableScan method build.
private RecordScan build(ResultSet rs) throws DatabaseException {
try {
RecordScan scan = null;
if (rs.next()) {
scan = new RecordScan(rs.getInt(SCANID), rs.getString(SCANNAME), rs.getDate(SCANTIME));
}
rs.close();
return scan;
} catch (SQLException e) {
throw new DatabaseException(e);
}
}
Aggregations