public class SFStatement extends SFBaseStatement
SFBaseStatement.CallingMethodMAX_STATEMENT_PARAMETERS, queryTimeout, statementParametersMap| Constructor and Description |
|---|
SFStatement(SFSession session) |
| Modifier and Type | Method and Description |
|---|---|
SFBaseResultSet |
asyncExecute(String sql,
Map<String,ParameterBindingDTO> parametersBinding,
SFBaseStatement.CallingMethod caller)
Execute sql asynchronously.
|
void |
cancel()
Aborts the statement.
|
void |
close()
Closes the statement.
|
SFStatementMetaData |
describe(String sql)
Describe a statement
|
SFBaseResultSet |
execute(String sql,
boolean asyncExec,
Map<String,ParameterBindingDTO> parametersBinding,
SFBaseStatement.CallingMethod caller)
Execute sql
|
SFBaseResultSet |
execute(String sql,
Map<String,ParameterBindingDTO> parametersBinding,
SFBaseStatement.CallingMethod caller)
Executes the given SQL string.
|
Object |
executeHelper(String sql,
String mediaType,
Map<String,ParameterBindingDTO> bindValues,
boolean describeOnly,
boolean internal,
boolean asyncExec)
A helper method to build URL and submit the SQL to snowflake for exec
|
String[] |
getChildQueryIds(String queryID)
Return an array of child query ID for the given query ID.
|
long |
getConservativeMemoryLimit() |
int |
getConservativePrefetchThreads() |
boolean |
getMoreResults() |
boolean |
getMoreResults(int current)
Sets the result set to the next one, if available.
|
SFBaseResultSet |
getResultSet()
Retrieves the current result as a ResultSet, if any.
|
SFBaseSession |
getSFBaseSession()
Returns the SFBaseSession associated with this SFBaseStatement.
|
boolean |
hasChildren()
If this is a multi-statement, i.e., has child results.
|
addProperty, executeSetProperty, isFileTransferpublic SFStatement(SFSession session)
public SFStatementMetaData describe(String sql) throws SFException, SQLException
describe in class SFBaseStatementsql - statementSQLException - if connection is already closedSFException - if result set is nullpublic Object executeHelper(String sql, String mediaType, Map<String,ParameterBindingDTO> bindValues, boolean describeOnly, boolean internal, boolean asyncExec) throws SnowflakeSQLException, SFException
sql - sql statementmediaType - media typebindValues - map of binding valuesdescribeOnly - whether only show the result set metadatainternal - run internal query not showing up in historySFException - if query is canceledSnowflakeSQLException - if query is already runningpublic int getConservativePrefetchThreads()
getConservativePrefetchThreads in class SFBaseStatementpublic long getConservativeMemoryLimit()
getConservativeMemoryLimit in class SFBaseStatementpublic String[] getChildQueryIds(String queryID) throws SQLException
If the given query ID is for a multiple statements query, it returns an array of its child statements, otherwise, it returns an array to include the given query ID.
getChildQueryIds in class SFBaseStatementqueryID - The given query IDSQLException - If the query is running or the corresponding query is FAILED.public SFBaseResultSet execute(String sql, Map<String,ParameterBindingDTO> parametersBinding, SFBaseStatement.CallingMethod caller) throws SQLException, SFException
SFBaseStatementexecute in class SFBaseStatementsql - The SQL string to execute, synchronously.parametersBinding - parameters to bindcaller - the JDBC interface method that called this method, if anySQLException - if failed to execute sqlSFException - exception raised from Snowflake componentspublic SFBaseResultSet execute(String sql, boolean asyncExec, Map<String,ParameterBindingDTO> parametersBinding, SFBaseStatement.CallingMethod caller) throws SQLException, SFException
sql - sql statement.parametersBinding - parameters to bindcaller - the JDBC interface method that called this method, if anySQLException - if failed to execute sqlSFException - exception raised from Snowflake componentsSQLException - if SQL error occurspublic void close()
SFBaseStatementclose in class SFBaseStatementpublic void cancel()
throws SFException,
SQLException
SFBaseStatementcancel in class SFBaseStatementSFException - if the statement is already closed.SQLException - if there are server-side errors from trying to abort.public SFBaseSession getSFBaseSession()
SFBaseStatementgetSFBaseSession in class SFBaseStatementpublic boolean getMoreResults()
throws SQLException
SQLExceptionpublic boolean getMoreResults(int current)
throws SQLException
SFBaseStatementgetMoreResults in class SFBaseStatementcurrent - What to do with the current result. One of Statement.CLOSE_CURRENT_RESULT,
Statement.CLOSE_ALL_RESULTS, or Statement.KEEP_CURRENT_RESULTSQLException - if something fails while getting the next resultpublic SFBaseResultSet getResultSet()
SFBaseStatementgetResultSet in class SFBaseStatementpublic boolean hasChildren()
SFBaseStatementhasChildren in class SFBaseStatementpublic SFBaseResultSet asyncExecute(String sql, Map<String,ParameterBindingDTO> parametersBinding, SFBaseStatement.CallingMethod caller) throws SQLException, SFException
SFBaseStatementasyncExecute in class SFBaseStatementsql - sql statement.parametersBinding - parameters to bindcaller - the JDBC interface method that called this method, if anySQLException - if failed to execute sqlSFException - exception raised from Snowflake componentsCopyright © 2022. All rights reserved.