if (arguments.length > 0) {
// need to do the (Object) cast to force args to be a single object
logger.trace("query arguments: {}", (Object) arguments);
}
DatabaseConnection connection = connectionSource.getReadOnlyConnection();
CompiledStatement compiledStatement = null;
try {
compiledStatement = connection.compileStatement(query, StatementType.SELECT, noFieldTypes);
assignStatementArguments(compiledStatement, arguments);
String[] columnNames = extractColumnNames(compiledStatement);
RawResultsImpl<Object[]> rawResults =
new RawResultsImpl<Object[]>(connectionSource, connection, query, Object[].class,
compiledStatement, columnNames, new ObjectArrayRowMapper(columnTypes));
compiledStatement = null;
connection = null;
return rawResults;
} finally {
if (compiledStatement != null) {
compiledStatement.close();
}
if (connection != null) {
connectionSource.releaseConnection(connection);
}
}