MCPcopy Index your code
hub / github.com/apache/groovy / executeQuery

Method executeQuery

subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java:4513–4522  ·  view source on GitHub ↗

Useful helper method which handles resource management when executing a query which returns a result set. Derived classes of Sql can override "createQueryCommand" and then call this method to access the ResultSet returned from the provided query or alternatively can use the higher-level method of Sq

(String sql)

Source from the content-addressed store, hash-verified

4511 * @throws SQLException if a database error occurs
4512 */
4513 protected final ResultSet executeQuery(String sql) throws SQLException {
4514 AbstractQueryCommand command = createQueryCommand(sql);
4515 ResultSet rs = null;
4516 try {
4517 rs = command.execute();
4518 } finally {
4519 command.closeResources();
4520 }
4521 return rs;
4522 }
4523
4524 /**
4525 * Useful helper method which handles resource management when executing a

Callers 4

queryMethod · 0.80
eachRowMethod · 0.80
runQueryMethod · 0.80
runQueryMethod · 0.80

Calls 3

createQueryCommandMethod · 0.95
executeMethod · 0.95
closeResourcesMethod · 0.95

Tested by

no test coverage detected