Groovy 2.2.0

groovy.sql
[Java] Class Sql.AbstractQueryCommand

java.lang.Object
  groovy.sql.Sql.AbstractQueryCommand

protected abstract class Sql.AbstractQueryCommand

Field Summary
protected String sql

protected Statement statement

 
Constructor Summary
protected Sql.AbstractQueryCommand(String sql)

 
Method Summary
protected void closeResources()

Perform the query.

protected void closeResources(ResultSet rs)

protected ResultSet execute()

After performing the execute operation and making use of its return, it's necessary to free the resources allocated for the statement.

protected ResultSet runQuery(Connection connection)

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

sql

protected final String sql


statement

protected Statement statement


 
Constructor Detail

Sql.AbstractQueryCommand

protected Sql.AbstractQueryCommand(String sql)


 
Method Detail

closeResources

protected final void closeResources()
Perform the query. Must set statement field so that the main (execute()) method can clean up. This is the method that encloses the variant part of the code.
throws:
SQLException if a database error occurs
Parameters:
connection - the connection to use
Returns:
ResultSet from an executeQuery method.


closeResources

protected final void closeResources(ResultSet rs)


execute

protected final ResultSet execute()
After performing the execute operation and making use of its return, it's necessary to free the resources allocated for the statement.
Parameters:
rs - allows the caller to conveniently close its resource as well


runQuery

protected ResultSet runQuery(Connection connection)


 

Copyright © 2003-2013 The Codehaus. All rights reserved.