Groovy 1.7.0

groovy.sql
Class Sql.AbstractQueryCommand

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

class Sql.AbstractQueryCommand

Field Summary
protected String sql

protected Statement statement

 
Constructor Summary
Sql.AbstractQueryCommand(String sql)

 
Method Summary
void closeResources()

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

void closeResources(ResultSet rs)

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

ResultSet execute()

Execute the command that's defined by the subclass following the Command pattern.

protected ResultSet runQuery(Connection connection)

Perform the query.

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

Field Detail

sql

protected final String sql


statement

protected Statement statement


 
Constructor Detail

Sql.AbstractQueryCommand

public Sql.AbstractQueryCommand(String sql)


 
Method Detail

closeResources

public final void closeResources()
After performing the execute operation and making use of its return, it's necessary to free the resources allocated for the statement.


closeResources

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


execute

public final ResultSet execute()
Execute the command that's defined by the subclass following the Command pattern. Specialized parameters are held in the command instances.
return:
ResultSet from executing a query
throws:
SQLException if a database error occurs


runQuery

protected ResultSet runQuery(Connection connection)
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.
param:
connection the connection to use
return:
ResultSet from an executeQuery method.
throws:
SQLException if a database error occurs


 

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