Java Reference
In-Depth Information
private int getWorkloadID(URL url, boolean require)
throws SQLException,
WorkloadException
{
int hash = 0;
RepeatableStatement.Results rs = null;
try
{
hash = computeHash(url);
rs = this.stmtGetWorkloadID.executeQuery(hash);
while (rs.getResultSet().next())
{
if (rs.getResultSet().getString(2).equals(url.toString()))
{
return rs.getResultSet().getInt(1);
}
}
} finally
{
if (rs != null)
{
rs.close();
}
}
if (require)
{
StringBuilder str = new StringBuilder();
str.append(
"Failed to find previously visited URL, hash=\"");
str.append(hash);
str.append("\", URL=\"");
str.append(url.toString());
str.append("\".");
throw (new WorkloadException(str.toString()));
} else
{
return -1;
}
}
/**
* Mark the specified host as processed.
*
* @param host
* The host to mark.
Search WWH ::




Custom Search