org.teiid.translator.jdbc
Class JDBCBaseExecution

java.lang.Object
  extended by org.teiid.translator.jdbc.JDBCBaseExecution
All Implemented Interfaces:
Execution
Direct Known Subclasses:
JDBCQueryExecution, JDBCUpdateExecution

public abstract class JDBCBaseExecution
extends java.lang.Object
implements Execution


Field Summary
protected  java.sql.Connection connection
           
protected  ExecutionContext context
           
protected  JDBCExecutionFactory executionFactory
           
protected  int fetchSize
           
protected  java.sql.Statement statement
           
protected  boolean trimString
           
 
Constructor Summary
protected JDBCBaseExecution(java.sql.Connection connection, ExecutionContext context, JDBCExecutionFactory jef)
           
 
Method Summary
 void addStatementWarnings()
           
protected  void bindPreparedStatementValues(java.sql.PreparedStatement stmt, TranslatedCommand tc, int rowCount)
          Bind the values in the TranslatedCommand to the PreparedStatement
 void cancel()
          Cancels the execution abnormally.
 void close()
          Terminates the execution normally.
protected  java.sql.CallableStatement getCallableStatement(java.lang.String sql)
           
 java.sql.Connection getConnection()
          Returns the JDBC connection used by the execution object.
protected  java.sql.PreparedStatement getPreparedStatement(java.lang.String sql)
           
protected  java.sql.Statement getStatement()
           
protected  void setSizeContraints(java.sql.Statement statement)
           
protected  TranslatedCommand translateCommand(Command command)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.teiid.translator.Execution
execute
 

Field Detail

connection

protected java.sql.Connection connection

context

protected ExecutionContext context

executionFactory

protected JDBCExecutionFactory executionFactory

trimString

protected boolean trimString

fetchSize

protected int fetchSize

statement

protected java.sql.Statement statement
Constructor Detail

JDBCBaseExecution

protected JDBCBaseExecution(java.sql.Connection connection,
                            ExecutionContext context,
                            JDBCExecutionFactory jef)
Method Detail

bindPreparedStatementValues

protected void bindPreparedStatementValues(java.sql.PreparedStatement stmt,
                                           TranslatedCommand tc,
                                           int rowCount)
                                    throws java.sql.SQLException
Bind the values in the TranslatedCommand to the PreparedStatement

Throws:
java.sql.SQLException

translateCommand

protected TranslatedCommand translateCommand(Command command)
                                      throws TranslatorException
Throws:
TranslatorException

close

public void close()
Description copied from interface: Execution
Terminates the execution normally.

Specified by:
close in interface Execution

cancel

public void cancel()
            throws TranslatorException
Description copied from interface: Execution
Cancels the execution abnormally. This will happen via a different thread from the one performing the execution, so should be expected to happen in a multi-threaded scenario.

Specified by:
cancel in interface Execution
Throws:
TranslatorException

setSizeContraints

protected void setSizeContraints(java.sql.Statement statement)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException

getStatement

protected java.sql.Statement getStatement()
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getCallableStatement

protected java.sql.CallableStatement getCallableStatement(java.lang.String sql)
                                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getPreparedStatement

protected java.sql.PreparedStatement getPreparedStatement(java.lang.String sql)
                                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection()
Returns the JDBC connection used by the execution object.

Returns:
Returns the connection.
Since:
4.1.1

addStatementWarnings

public void addStatementWarnings()
                          throws java.sql.SQLException
Throws:
java.sql.SQLException


Copyright © 2010. All Rights Reserved.