//============================================================================== // SqlObjectResultSet.java // // Note: This requires Java 1.5 or later. //============================================================================== package tribble.sql; import java.lang.Character; import java.lang.String; import java.lang.StringBuilder; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.HashMap; /******************************************************************************* * SQL query result set. * See {@link SqlTypeQuery} for details. * * *
* Note: This requires Java 1.5 or later. * *
* Copyright ©2008 by David R. Tribble, all rights reserved.
* Note that this method never throws SQLException, even if such an
* exception results during the closing of the result set.
*
* @since 1.1, 2008-02-24
*/
public void close()
{
// Close the result set
if (m_results != null)
{
m_results.close();
m_results = null;
}
}
/***************************************************************************
* Determines if there is a next row in the results of the SQL query, and
* advances to that row.
*
* @throws SQLException
* Thrown if an error occurs when the SQL result set is advanced to the next
* result row.
*
* @since 1.1, 2008-02-24
*/
public boolean next()
throws SQLException
{
// Sanity check
if (m_results == null)
throw new SQLException("Result set is no longer active");
// Advance the result set pointer to the next result row
return m_results.next();
}
/***************************************************************************
* Retrieve the next row from the results of the SQL query.
*
* @since 1.1, 2008-02-14
*/
public ResultType getResult()
throws SQLException
{
// Sanity check
if (m_results == null)
throw new SQLException("Result set is no longer active");
// Create a new object for the current result row
return (ResultType) m_results.getResult();
}
}
// End SqlTypeResultSet.java
* Permission is granted to any person or entity except those designated by
* by the United States Department of State as a terrorist, or terrorist
* government or agency, to use and distribute this source code provided
* that the original copyright notice remains present and unaltered.
*/
public class SqlTypeResultSet