org.oddjob.sql
Class ParameterisedExecutor

java.lang.Object
  extended by org.oddjob.sql.ParameterisedExecutor
All Implemented Interfaces:
ArooaSessionAware, BusAware, Destination<String>, SQLExecutor

public class ParameterisedExecutor
extends Object
implements ArooaSessionAware, SQLExecutor, BusAware


Constructor Summary
ParameterisedExecutor()
           
 
Method Summary
 void accept(String sql)
          Execute the SQL.
 void execute(String sql)
          Exec the sql statement.
 Connection getConnection()
           
 int getExecutedSQLCount()
           
 ValueType getParameters(int index)
           
 int getSuccessfulSQLCount()
           
 boolean isAutocommit()
           
 boolean isCallable()
           
 boolean isEscapeProcessing()
           
 void setArooaSession(ArooaSession session)
           
 void setAutocommit(boolean autocommit)
          Auto commit flag for database connection; optional, default false.
 void setBus(BeanBus bus)
           
 void setCallable(boolean callable)
           
 void setConnection(Connection connection)
           
 void setEscapeProcessing(boolean escapeProcessing)
           
 void setParameters(int index, ValueType parameter)
           
 void setResultProcessor(SQLResultsProcessor processor)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterisedExecutor

public ParameterisedExecutor()
Method Detail

setArooaSession

public void setArooaSession(ArooaSession session)
Specified by:
setArooaSession in interface ArooaSessionAware

accept

public void accept(String sql)
            throws BadBeanException
Description copied from interface: SQLExecutor
Execute the SQL.

Specified by:
accept in interface Destination<String>
Specified by:
accept in interface SQLExecutor
Parameters:
sql - The SQL. Never expected to be null.
Throws:
BadBeanException

execute

public void execute(String sql)
             throws SQLException,
                    NoConversionAvailableException,
                    ConversionFailedException,
                    BusException,
                    ClassNotFoundException
Exec the sql statement.

Parameters:
sql - the SQL statement to execute
out - the place to put output
Throws:
SQLException - on SQL problems
ConversionFailedException
NoConversionAvailableException
BusException
ClassNotFoundException

stop

public void stop()

setBus

public void setBus(BeanBus bus)
Specified by:
setBus in interface BusAware

setResultProcessor

public void setResultProcessor(SQLResultsProcessor processor)

getConnection

public Connection getConnection()

setConnection

public void setConnection(Connection connection)

setAutocommit

public void setAutocommit(boolean autocommit)
Auto commit flag for database connection; optional, default false.

Parameters:
autocommit - The autocommit to set

isAutocommit

public boolean isAutocommit()

isEscapeProcessing

public boolean isEscapeProcessing()

setEscapeProcessing

public void setEscapeProcessing(boolean escapeProcessing)

getParameters

public ValueType getParameters(int index)

setParameters

public void setParameters(int index,
                          ValueType parameter)

isCallable

public boolean isCallable()

setCallable

public void setCallable(boolean callable)

getExecutedSQLCount

public int getExecutedSQLCount()

getSuccessfulSQLCount

public int getSuccessfulSQLCount()