com.agimatec.sql.query
Class JdbcExecutor

java.lang.Object
  extended by com.agimatec.sql.query.JdbcExecutor
Direct Known Subclasses:
JdbcQueryUtil

public abstract class JdbcExecutor
extends java.lang.Object

Abstract superclass of classes that execute direct sql statements.

Author:
Roman Stumm

Field Summary
protected static org.apache.commons.logging.Log log
           
 
Constructor Summary
JdbcExecutor()
           
 
Method Summary
protected  int execRowsAffected(SQLStatement aSQL)
          execute an sql (update/delete/insert) statement and return the number of rows affected
protected  QueryResult fetchResult(SQLStatement aQuery, JdbcResultBuilder resultBuilder, QueryDefinition queryDefinition)
          execute a SQL-QUERY (select) and return a LookupResult
abstract  java.sql.Connection getConnection()
           
protected  JdbcResultBuilder newResultVisitor(java.lang.String className)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
Constructor Detail

JdbcExecutor

public JdbcExecutor()
Method Detail

fetchResult

protected QueryResult fetchResult(SQLStatement aQuery,
                                  JdbcResultBuilder resultBuilder,
                                  QueryDefinition queryDefinition)
                           throws java.sql.SQLException
execute a SQL-QUERY (select) and return a LookupResult

Parameters:
aQuery - - the SQLStatement
resultBuilder - - a result visitor that builds the result rows or objects
queryDefinition - - the max. number of rows to build (or GenericQuery.C_Unlimited)
Returns:
a LookupResult
Throws:
java.lang.Exception
java.sql.SQLException

execRowsAffected

protected int execRowsAffected(SQLStatement aSQL)
                        throws java.sql.SQLException
execute an sql (update/delete/insert) statement and return the number of rows affected

Returns:
the number of rows affected (if the database provides that info)
Throws:
java.sql.SQLException

newResultVisitor

protected JdbcResultBuilder newResultVisitor(java.lang.String className)

getConnection

public abstract java.sql.Connection getConnection()


Copyright © 2008-2012. All Rights Reserved.