Package org.apache.flink.table.jdbc
Class FlinkStatement
- java.lang.Object
-
- org.apache.flink.table.jdbc.BaseStatement
-
- org.apache.flink.table.jdbc.FlinkStatement
-
- All Implemented Interfaces:
AutoCloseable,Statement,Wrapper
@NotThreadSafe public class FlinkStatement extends BaseStatement
Statement for flink jdbc driver. Notice that the statement is not thread safe.
-
-
Field Summary
-
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
-
-
Constructor Summary
Constructors Constructor Description FlinkStatement(FlinkConnection connection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()voidclearWarnings()voidclose()booleanexecute(String sql)Execute a sql statement.ResultSetexecuteQuery(String sql)Execute a SELECT query.ConnectiongetConnection()booleangetMoreResults()ResultSetgetResultSet()intgetUpdateCount()SQLWarninggetWarnings()booleanisClosed()-
Methods inherited from class org.apache.flink.table.jdbc.BaseStatement
addBatch, clearBatch, closeOnCompletion, execute, execute, execute, executeBatch, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getQueryTimeout, getResultSetConcurrency, getResultSetHoldability, getResultSetType, isCloseOnCompletion, isPoolable, isWrapperFor, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unwrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.sql.Statement
enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, getLargeMaxRows, getLargeUpdateCount, isSimpleIdentifier, setLargeMaxRows
-
-
-
-
Constructor Detail
-
FlinkStatement
public FlinkStatement(FlinkConnection connection)
-
-
Method Detail
-
executeQuery
public ResultSet executeQuery(String sql) throws SQLException
Execute a SELECT query.- Parameters:
sql- an SQL statement to be sent to the database, typically a static SQLSELECTstatement- Returns:
- the select query result set.
- Throws:
SQLException- the thrown exception
-
close
public void close() throws SQLException- Throws:
SQLException
-
cancel
public void cancel() throws SQLException- Throws:
SQLException
-
getWarnings
public SQLWarning getWarnings() throws SQLException
- Throws:
SQLException
-
clearWarnings
public void clearWarnings() throws SQLException- Throws:
SQLException
-
execute
public boolean execute(String sql) throws SQLException
Execute a sql statement. Notice that theINSERTstatement in Flink would return job id as result set.- Parameters:
sql- any SQL statement- Returns:
- True if there is result set for the statement.
- Throws:
SQLException- the thrown exception.
-
getResultSet
public ResultSet getResultSet() throws SQLException
- Throws:
SQLException
-
getMoreResults
public boolean getMoreResults() throws SQLException- Throws:
SQLException
-
getUpdateCount
public int getUpdateCount() throws SQLException- Throws:
SQLException
-
getConnection
public Connection getConnection() throws SQLException
- Throws:
SQLException
-
isClosed
public boolean isClosed() throws SQLException- Throws:
SQLException
-
-