use of org.parosproxy.paros.db.RecordTag in project zaproxy by zaproxy.
the class SqlTableTag method getTagsForHistoryID.
/* (non-Javadoc)
* @see org.parosproxy.paros.db.paros.TableTag#getTagsForHistoryID(long)
*/
@Override
public List<RecordTag> getTagsForHistoryID(long historyId) throws DatabaseException {
SqlPreparedStatementWrapper psGetTagsForHistoryId = null;
try {
psGetTagsForHistoryId = DbSQL.getSingleton().getPreparedStatement("tag.ps.gettagsforhid");
List<RecordTag> result = new ArrayList<>();
psGetTagsForHistoryId.getPs().setLong(1, historyId);
try (ResultSet rs = psGetTagsForHistoryId.getPs().executeQuery()) {
while (rs.next()) {
result.add(new RecordTag(rs.getLong(TAGID), rs.getLong(TAGID), rs.getString(TAG)));
}
}
return result;
} catch (SQLException e) {
throw new DatabaseException(e);
} finally {
DbSQL.getSingleton().releasePreparedStatement(psGetTagsForHistoryId);
}
}
use of org.parosproxy.paros.db.RecordTag in project zaproxy by zaproxy.
the class SqlTableTag method read.
/* (non-Javadoc)
* @see org.parosproxy.paros.db.paros.TableTag#read(long)
*/
@Override
public synchronized RecordTag read(long tagId) throws DatabaseException {
SqlPreparedStatementWrapper psRead = null;
try {
psRead = DbSQL.getSingleton().getPreparedStatement("tag.ps.read");
psRead.getPs().setLong(1, tagId);
try (ResultSet rs = psRead.getPs().executeQuery()) {
RecordTag result = build(rs);
return result;
}
} catch (SQLException e) {
throw new DatabaseException(e);
} finally {
DbSQL.getSingleton().releasePreparedStatement(psRead);
}
}
use of org.parosproxy.paros.db.RecordTag in project zaproxy by zaproxy.
the class ParosTableTag method getTagsForHistoryID.
/* (non-Javadoc)
* @see org.parosproxy.paros.db.paros.TableTag#getTagsForHistoryID(long)
*/
@Override
public synchronized List<RecordTag> getTagsForHistoryID(long historyId) throws DatabaseException {
try {
List<RecordTag> result = new ArrayList<>();
psGetTagsForHistoryId.setLong(1, historyId);
try (ResultSet rs = psGetTagsForHistoryId.executeQuery()) {
while (rs.next()) {
result.add(new RecordTag(rs.getLong(TAGID), rs.getLong(TAGID), rs.getString(TAG)));
}
}
return result;
} catch (SQLException e) {
throw new DatabaseException(e);
}
}
Aggregations