Java Reference
In-Depth Information
RepeatableStatement.Results rs = null;
try
{
rs = this.stmtGetHost.executeQuery(hostID);
if (!rs.getResultSet().next())
{
throw new WorkloadException(
"Can't find previously created host.");
}
return rs.getResultSet().getString(1);
} catch (SQLException e)
{
throw new WorkloadException(e);
} finally
{
if (rs != null)
{
rs.close();
}
}
}
/**
* Get the id for the specified host name.
*
* @param host
* The host to lookup.
* @param require
* Should an exception be thrown if the host is
* not located.
* @return The id of the specified host name.
* @throws WorkloadException
* Thrown if the host id is not found, and is
* required.
* @throws SQLException
* Thrown if a SQL error occurs.
*/
private int getHostID(String host, boolean require)
throws WorkloadException,
SQLException
{
RepeatableStatement.Results rs = null;
// is this the current host?
if (this.currentHostID != -1)
Search WWH ::




Custom Search