public class SFStatement extends Object
| Constructor and Description |
|---|
SFStatement(SFSession session) |
| Modifier and Type | Method and Description |
|---|---|
void |
addProperty(String propertyName,
Object propertyValue)
Add a statement parameter
Make sure a property is not added more than once and the number of
properties does not exceed limit.
|
void |
cancel() |
void |
close() |
SFStatementMetaData |
describe(String sql)
Describe a statement
|
SFBaseResultSet |
execute(String sql,
Map<String,ParameterBindingDTO> parametersBinding)
Execute sql
|
Object |
executeHelper(String sql,
String mediaType,
Map<String,ParameterBindingDTO> bindValues,
boolean describeOnly,
boolean internal)
A helper method to build URL and submit the SQL to snowflake for exec
|
void |
executeSetProperty(String sql) |
protected SFSession |
getSession() |
void |
setHasUnsupportedStageBind(boolean hasUnsupportedStageBind) |
public SFStatement(SFSession session)
public void addProperty(String propertyName, Object propertyValue) throws SFException
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) 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 SFBaseResultSet execute(String sql, Map<String,ParameterBindingDTO> parametersBinding) throws SQLException, SFException
sql - sql statement.parametersBinding - parameters to bindSQLException - if failed to execute sqlSFException - exception raised from Snowflake componentsSQLException - if SQL error occurspublic void close()
throws SQLException
SQLExceptionpublic void cancel()
throws SFException,
SQLException
SFExceptionSQLExceptionpublic void executeSetProperty(String sql)
protected SFSession getSession()
public void setHasUnsupportedStageBind(boolean hasUnsupportedStageBind)
Copyright © 2018. All rights reserved.