public class SFStatement extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SFStatement.CallingMethod |
| Constructor and Description |
|---|
SFStatement(SFSession session) |
| Modifier and Type | Method and Description |
|---|---|
void |
addProperty(String propertyName,
Object propertyValue)
Add a statement parameter
|
void |
cancel() |
void |
close() |
SFStatementMetaData |
describe(String sql)
Describe a statement
|
SFBaseResultSet |
execute(String sql,
boolean asyncExec,
Map<String,ParameterBindingDTO> parametersBinding,
SFStatement.CallingMethod caller)
Execute sql
|
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
|
void |
executeSetProperty(String sql) |
long |
getConservativeMemoryLimit() |
int |
getConservativePrefetchThreads() |
boolean |
getMoreResults() |
boolean |
getMoreResults(int current)
Sets the result set to the next one, if available.
|
SFBaseResultSet |
getResultSet() |
protected SFSession |
getSession() |
boolean |
hasChildren() |
public SFStatement(SFSession session)
public void addProperty(String propertyName, Object propertyValue) throws SFException
Make sure a property is not added more than once and the number of properties does not exceed limit.
propertyName - property namepropertyValue - property valueSFException - if too many parameters for a statementpublic SFStatementMetaData describe(String sql) throws SFException, SQLException
sql - 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()
public long getConservativeMemoryLimit()
public SFBaseResultSet execute(String sql, boolean asyncExec, Map<String,ParameterBindingDTO> parametersBinding, SFStatement.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()
public void cancel()
throws SFException,
SQLException
SFExceptionSQLExceptionpublic void executeSetProperty(String sql)
protected SFSession getSession()
public boolean getMoreResults()
throws SQLException
SQLExceptionpublic boolean getMoreResults(int current)
throws SQLException
current - 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()
public boolean hasChildren()
Copyright © 2020. All rights reserved.