org.springframework.jdbc.object
Class SqlOperation

java.lang.Object
  extended byorg.springframework.jdbc.object.RdbmsOperation
      extended byorg.springframework.jdbc.object.SqlOperation
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
SqlQuery, SqlUpdate

public abstract class SqlOperation
extends RdbmsOperation

RdbmsOperation using a JdbcTemplate and representing a SQL-based operation such as a query or update, as opposed to a stored procedure.

Configures a PreparedStatementCreatorFactory based on the declared parameters.

Version:
$Id: SqlOperation.java,v 1.10 2004/03/18 02:46:13 trisberg Exp $
Author:
Rod Johnson, Juergen Hoeller

Field Summary
 
Fields inherited from class org.springframework.jdbc.object.RdbmsOperation
logger
 
Constructor Summary
SqlOperation()
           
 
Method Summary
protected  void compileInternal()
          Overridden method to configure the PreparedStatementCreatorFactory based on our declared parameters.
protected  int getResultSetType()
          Return whether prepared statements will return a specific type of ResultSet.
protected  boolean isUpdatableResults()
          Return whether prepared statements will return updatable ResultSets.
protected  PreparedStatementCreator newPreparedStatementCreator(java.lang.Object[] params)
          Return a PreparedStatementCreator to perform an operation with this parameters.
protected  void onCompileInternal()
          Hook method that subclasses may override to react to compilation.
protected  void setResultSetType(int resultSetType)
          Set whether to use prepared statements that return a specific type of ResultSet.
protected  void setUpdatableResults(boolean updatableResults)
          Set whether to use prepared statements capable of returning updatable ResultSets.
 
Methods inherited from class org.springframework.jdbc.object.RdbmsOperation
afterPropertiesSet, compile, declareParameter, getDeclaredParameters, getJdbcTemplate, getSql, isCompiled, setDataSource, setJdbcTemplate, setSql, setTypes, validateParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlOperation

public SqlOperation()
Method Detail

setResultSetType

protected void setResultSetType(int resultSetType)
Set whether to use prepared statements that return a specific type of ResultSet.

Parameters:
resultSetType - the ResultSet type
See Also:
ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_SCROLL_SENSITIVE

getResultSetType

protected int getResultSetType()
Return whether prepared statements will return a specific type of ResultSet.


setUpdatableResults

protected void setUpdatableResults(boolean updatableResults)
Set whether to use prepared statements capable of returning updatable ResultSets.


isUpdatableResults

protected boolean isUpdatableResults()
Return whether prepared statements will return updatable ResultSets.


compileInternal

protected final void compileInternal()
Overridden method to configure the PreparedStatementCreatorFactory based on our declared parameters.

Specified by:
compileInternal in class RdbmsOperation
See Also:
RdbmsOperation.compileInternal()

onCompileInternal

protected void onCompileInternal()
Hook method that subclasses may override to react to compilation. This implementation does nothing.


newPreparedStatementCreator

protected PreparedStatementCreator newPreparedStatementCreator(java.lang.Object[] params)
Return a PreparedStatementCreator to perform an operation with this parameters.

Parameters:
params - parameters. May be null.


Copyright (C) 2003-2004 The Spring Framework Project.