Package org.teiid.translator.jdbc
Class JDBCBaseExecution
- java.lang.Object
-
- org.teiid.translator.jdbc.JDBCBaseExecution
-
- All Implemented Interfaces:
Execution
- Direct Known Subclasses:
JDBCQueryExecution,JDBCUpdateExecution
public abstract class JDBCBaseExecution extends Object implements Execution
-
-
Field Summary
Fields Modifier and Type Field Description protected Commandcommandprotected Connectionconnectionprotected ExecutionContextcontextprotected JDBCExecutionFactoryexecutionFactoryprotected intfetchSizeprotected Statementstatementprotected booleantrimString
-
Constructor Summary
Constructors Modifier Constructor Description protectedJDBCBaseExecution(Command command, Connection connection, ExecutionContext context, JDBCExecutionFactory jef)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddStatementWarnings()protected voidbind(PreparedStatement stmt, List<?> params, List<?> batchValues)Bind the values in the TranslatedCommand to the PreparedStatementvoidcancel()Cancels the execution abnormally.voidclose()Terminates the execution normally.protected CallableStatementgetCallableStatement(String sql)ConnectiongetConnection()Returns the JDBC connection used by the execution object.protected PreparedStatementgetPreparedStatement(String sql)protected StatementgetStatement()protected voidsetSizeContraints(Statement statement)protected TranslatedCommandtranslateCommand(Command command)
-
-
-
Field Detail
-
connection
protected Connection connection
-
context
protected ExecutionContext context
-
executionFactory
protected JDBCExecutionFactory executionFactory
-
command
protected Command command
-
trimString
protected boolean trimString
-
fetchSize
protected int fetchSize
-
statement
protected volatile Statement statement
-
-
Constructor Detail
-
JDBCBaseExecution
protected JDBCBaseExecution(Command command, Connection connection, ExecutionContext context, JDBCExecutionFactory jef)
-
-
Method Detail
-
bind
protected void bind(PreparedStatement stmt, List<?> params, List<?> batchValues) throws SQLException
Bind the values in the TranslatedCommand to the PreparedStatement- Throws:
SQLException
-
translateCommand
protected TranslatedCommand translateCommand(Command command) throws TranslatorException
- Throws:
TranslatorException
-
close
public void close()
Description copied from interface:ExecutionTerminates the execution normally.
-
cancel
public void cancel() throws TranslatorExceptionDescription copied from interface:ExecutionCancels 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:
cancelin interfaceExecution- Throws:
TranslatorException
-
setSizeContraints
protected void setSizeContraints(Statement statement)
-
getStatement
protected Statement getStatement() throws SQLException
- Throws:
SQLException
-
getCallableStatement
protected CallableStatement getCallableStatement(String sql) throws SQLException
- Throws:
SQLException
-
getPreparedStatement
protected PreparedStatement getPreparedStatement(String sql) throws SQLException
- Throws:
SQLException
-
getConnection
public Connection getConnection()
Returns the JDBC connection used by the execution object.- Returns:
- Returns the connection.
- Since:
- 4.1.1
-
addStatementWarnings
public void addStatementWarnings() throws SQLException- Throws:
SQLException
-
-