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 Command
command
protected Connection
connection
protected ExecutionContext
context
protected JDBCExecutionFactory
executionFactory
protected int
fetchSize
protected Statement
statement
protected boolean
trimString
-
Constructor Summary
Constructors Modifier Constructor Description protected
JDBCBaseExecution(Command command, Connection connection, ExecutionContext context, JDBCExecutionFactory jef)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addStatementWarnings()
protected void
bind(PreparedStatement stmt, List<?> params, List<?> batchValues)
Bind the values in the TranslatedCommand to the PreparedStatementvoid
cancel()
Cancels the execution abnormally.void
close()
Terminates the execution normally.protected CallableStatement
getCallableStatement(String sql)
Connection
getConnection()
Returns the JDBC connection used by the execution object.protected PreparedStatement
getPreparedStatement(String sql)
protected Statement
getStatement()
protected void
setSizeContraints(Statement statement)
protected TranslatedCommand
translateCommand(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:Execution
Terminates the execution normally.
-
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 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
-
-