public class SqlExecuteCommand extends PostCommand<CommandResponse>
LabKey SQL is variant of standard SQL that supports most of the SELECT-related operations. For more information on LabKey SQL, see the following page:
https://www.labkey.org/Documentation/wiki-page.view?name=labkeySql
Uses stream-lined sql-execute.api instead of query-executesql.api
Command.CommonParameters, Command.Response
CONTENT_TYPE_JSON
Constructor and Description |
---|
SqlExecuteCommand(SqlExecuteCommand source) |
SqlExecuteCommand(java.lang.String schemaName)
Constructs an ExecuteSqlCommand, initialized with a schema name.
|
SqlExecuteCommand(java.lang.String schemaName,
java.lang.String sql)
Constructs an ExecuteSqlCommand, initialized with a schema name and SQL query.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFieldSeparator() |
org.json.simple.JSONObject |
getJsonObject()
Returns the JSON object to post, or null if the JSON object
has not yet been set.
|
java.lang.String |
getLineSeparator() |
java.util.Map<java.lang.String,java.lang.Object> |
getQueryParameters()
Map of name (string)/value pairs for the values of parameters if the SQL references underlying queries
that are parameterized.
|
java.lang.String |
getSchemaName() |
java.lang.String |
getSql()
Returns the current SQL query.
|
void |
setQueryParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
Map of name (string)/value pairs for the values of parameters if the SQL references underlying queries
that are parameterized.
|
void |
setSchemaName(java.lang.String schemaName)
Sets the current schema name.
|
void |
setSql(java.lang.String sql)
Sets the SQL query to execute.
|
copy, createRequest, setJsonObject
_execute, checkThrowError, createResponse, execute, getActionName, getActionUrl, getControllerName, getHttpRequest, getParameters, getParamValueAsString, getQueryString, getRequiredVersion, getTimeout, setParameters, setRequiredVersion, setTimeout
public SqlExecuteCommand(java.lang.String schemaName)
When using this constructor, you must call the setSql(String)
method before executing the command.
schemaName
- The schema name to query.public SqlExecuteCommand(SqlExecuteCommand source)
public SqlExecuteCommand(java.lang.String schemaName, java.lang.String sql)
schemaName
- The schema name ot query.sql
- The SQL query.public java.lang.String getSchemaName()
public void setSchemaName(java.lang.String schemaName)
schemaName
- The new schema name to query.public java.lang.String getSql()
public void setSql(java.lang.String sql)
sql
- The new SQL query.public java.util.Map<java.lang.String,java.lang.Object> getQueryParameters()
public void setQueryParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
parameters
- a map of the named parameters to use in the underlying parameterized queriespublic java.lang.String getLineSeparator()
public java.lang.String getFieldSeparator()
public org.json.simple.JSONObject getJsonObject()
PostCommand
getJsonObject
in class PostCommand<CommandResponse>