public class SqlRequest extends Object implements ObjectStorage, Serializable
SqlService
,
Serialized FormModifier and Type | Field and Description |
---|---|
static String |
EXECUTE_EXTERNAL
The EXECUTE_EXTERNAL.
|
static String |
EXECUTE_SQL
The EXECUTE_SQL.
|
static String |
EXECUTE_SQL_SCRIPT
The EXECUTE_SQL_SCRIPT.
|
Constructor and Description |
---|
SqlRequest(SessionConnectionProvider<Alias> provider,
ConnectionParamsProvider<Alias> paramsProvider,
SqlParser parser,
Driver driver,
Map<String,Object> properties,
String sql,
boolean hasParams,
boolean doNotLog)
Instantiates a new sql request.
|
SqlRequest(SessionConnectionProvider<Alias> provider,
ConnectionParamsProvider<Alias> paramsProvider,
SqlParser parser,
Driver driver,
Map<String,Object> properties,
String sql,
boolean hasParams,
boolean commit,
boolean close,
boolean doNotLog)
Instantiates a new sql request.
|
SqlRequest(SessionConnectionProvider<Alias> provider,
ConnectionParamsProvider<Alias> paramsProvider,
SqlParser parser,
Driver driver,
Map<String,Object> properties,
String sql,
boolean hasParams,
boolean commit,
boolean close,
int maxRows,
boolean doNotLog)
Instantiates a new sql request.
|
Modifier and Type | Method and Description |
---|---|
boolean |
doNotLog()
Checks do not log flag.
|
ConnectionParamsProvider<Alias> |
getConnectionParamsProvider()
Gets the connection params provider.
|
Driver |
getDriver()
Gets the driver.
|
int |
getMaxRows()
Gets the maximum number of rows.
|
SqlParser |
getParser()
Gets the sql parser.
|
Map<String,Object> |
getProperties()
Gets the properties.
|
SessionConnectionProvider<Alias> |
getProvider()
Gets the connection provider.
|
String |
getSql()
Gets the sql to execute.
|
String |
getString(String key)
Gets the string representation of the value by the key.
|
String |
getType()
Gets the request type (execute sql, script, external tool, etc).
|
Object |
getValue(String key)
Gets the value by the key.
|
boolean |
hasParams()
Checks if "has params" flag is set.
|
boolean |
isAutoCommit()
Checks if auto commit is set.
|
boolean |
isCaptureLog()
Checks if dbms log should be captured after SQL script is executed.
|
boolean |
isClose()
Checks if "close when done" flag is set.
|
boolean |
isCommit()
Checks if "commit when done" flag is set.
|
boolean |
isExecuteQuery()
Checks if execute query should be used instead of execute.
|
boolean |
isReturnSql()
If true the response will include actual executed sql.
|
void |
setAutoCommit(boolean value)
Sets the auto commit flag.
|
void |
setCaptureLog(boolean value)
Sets the value of the "capture log" flag.
|
void |
setConnectionParamsProvider(ConnectionParamsProvider<Alias> paramsProvider)
Sets the connection params provider.
|
void |
setDriver(Driver driver)
Sets the driver.
|
void |
setHasParams(boolean hashParams)
Sets the "has params" flag.
|
void |
setIsExecuteQuery(boolean value)
Sets the "is execute query" flag.
|
void |
setParser(SqlParser parser)
Sets the sql parser.
|
void |
setProperties(LinkedHashMap<String,Object> properties)
Sets the properties.
|
void |
setProvider(SessionConnectionProvider<Alias> provider)
Sets the connection provider.
|
void |
setReturnSql(boolean value)
Sets the "return sql" flag.
|
void |
setSql(String sql)
Sets the sql.
|
void |
setType(String value)
Sets the request type (execute sql, script, external tool, etc).
|
void |
setValue(String key,
Object value)
Associates value with the key.
|
public static final String EXECUTE_SQL
public static final String EXECUTE_SQL_SCRIPT
public static final String EXECUTE_EXTERNAL
public SqlRequest(SessionConnectionProvider<Alias> provider, ConnectionParamsProvider<Alias> paramsProvider, SqlParser parser, Driver driver, Map<String,Object> properties, String sql, boolean hasParams, boolean doNotLog)
provider
- the connection providerparamsProvider
- the connection params providerparser
- the sql parserdriver
- the driverproperties
- the propertiessql
- the sqlhasParams
- the "has params" flagdoNotLog
- the do not log flagpublic SqlRequest(SessionConnectionProvider<Alias> provider, ConnectionParamsProvider<Alias> paramsProvider, SqlParser parser, Driver driver, Map<String,Object> properties, String sql, boolean hasParams, boolean commit, boolean close, boolean doNotLog)
provider
- the connection providerparamsProvider
- the connection params providerparser
- the sql parserdriver
- the driverproperties
- the propertiessql
- the sqlhasParams
- the "has params" flagcommit
- the "commit when done" flagclose
- the "close when done" flagdoNotLog
- the do not log flagpublic SqlRequest(SessionConnectionProvider<Alias> provider, ConnectionParamsProvider<Alias> paramsProvider, SqlParser parser, Driver driver, Map<String,Object> properties, String sql, boolean hasParams, boolean commit, boolean close, int maxRows, boolean doNotLog)
provider
- the connection providerparamsProvider
- the connection params providerparser
- the sql parserdriver
- the driverproperties
- the propertiessql
- the sqlhasParams
- the "has params" flagcommit
- the "commit when done" flagclose
- the "close when done" flagmaxRows
- the maximum number of rowsdoNotLog
- the do not logpublic boolean doNotLog()
public ConnectionParamsProvider<Alias> getConnectionParamsProvider()
public Driver getDriver()
public int getMaxRows()
public SqlParser getParser()
public Map<String,Object> getProperties()
public SessionConnectionProvider<Alias> getProvider()
public String getSql()
public String getString(String key)
ObjectStorage
getString
in interface ObjectStorage
key
- the keypublic String getType()
public Object getValue(String key)
ObjectStorage
getValue
in interface ObjectStorage
key
- the keypublic boolean hasParams()
public boolean isAutoCommit()
public boolean isCaptureLog()
public boolean isClose()
public boolean isCommit()
public boolean isExecuteQuery()
public boolean isReturnSql()
public void setAutoCommit(boolean value)
value
- the new auto commit flagpublic void setCaptureLog(boolean value)
value
- the new value of the "capture log" flagpublic void setConnectionParamsProvider(ConnectionParamsProvider<Alias> paramsProvider)
paramsProvider
- the new connection params providerpublic void setDriver(Driver driver)
driver
- the new driverpublic void setHasParams(boolean hashParams)
hashParams
- the new value for the "has params" flagpublic void setIsExecuteQuery(boolean value)
value
- the new value of the "is execute query" flagpublic void setParser(SqlParser parser)
parser
- the new sql parserpublic void setProperties(LinkedHashMap<String,Object> properties)
properties
- the new propertiespublic void setProvider(SessionConnectionProvider<Alias> provider)
provider
- the new connection providerpublic void setReturnSql(boolean value)
value
- the new value for "return sql" flagpublic void setSql(String sql)
sql
- the new sqlpublic void setType(String value)
value
- the new typepublic void setValue(String key, Object value)
ObjectStorage
setValue
in interface ObjectStorage
key
- the keyvalue
- the valueCopyright © 2010-2020 Toolsverse. All Rights Reserved.