public class SqlServiceImpl extends Object implements SqlService
DB_LOG_TYPE, DELETE_TYPE, DML_TYPE, EXCEPTION_TYPE, EXECUTE_SCRIPT_TYPE, EXECUTE_TYPE, EXPLAIN_PLAN_TYPE, INSERT_TYPE, MERGE_TYPE, NOTHING_TYPE, OUTPUT_PARAM_TYPE, SELECT_TYPE, UPDATE_TYPE
Constructor and Description |
---|
SqlServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
cancel(SessionConnectionProvider<Alias> provider)
Cancels currently executed sql.
|
void |
clear()
Sets current statement, external process, and result set to null.
|
void |
commitTransaction(SessionConnectionProvider<Alias> provider,
Alias params,
boolean closeOnCommit)
Commits current transaction.
|
SqlResult |
executeAutotrace(SqlRequest sqlRequest)
Executes autotrace
|
SqlResult |
executeExplainPlan(SqlRequest sqlRequest)
Executes explain plan if supported by driver passed in the sql request.
|
SqlResult |
executeExternal(SqlRequest sqlRequest)
Executes sql using external tool if supported by driver passed in the sql request.
|
SqlResult |
executeScript(SqlRequest sqlRequest)
Executes sql script, for example anonymous sql block if supported by driver passed in the sql request.
|
SqlResult |
executeSql(SqlRequest sqlRequest)
Executes sql.
|
LogNode |
getLogNode(String m,
Object ret,
Object[] args,
Throwable ex)
Gets the log node.
|
Map<String,FieldDef> |
getMetaData(SqlRequest sqlRequest)
Gets the meta data for the database object (table, view or synonym).
|
String |
getPropertyName()
Get the configuration property name used to enable\disable logging for the service.
|
boolean |
isLogByDefault()
Checks if service call should be logged by default.
|
void |
releaseConnection(SessionConnectionProvider<Alias> provider,
Alias params)
Releases connection.
|
void |
rollbackTransaction(SessionConnectionProvider<Alias> provider,
Alias params,
boolean closeOnRollback)
Rollbacks current transaction.
|
public void cancel(SessionConnectionProvider<Alias> provider)
SqlService
cancel
in interface SqlService
provider
- the connection providerpublic void clear()
public void commitTransaction(SessionConnectionProvider<Alias> provider, Alias params, boolean closeOnCommit) throws Exception
SqlService
commitTransaction
in interface SqlService
provider
- the connection providerparams
- the aliscloseOnCommit
- the close on commit flag. If set the connection will be released on commitException
- the exceptionpublic SqlResult executeAutotrace(SqlRequest sqlRequest) throws Exception
SqlService
executeAutotrace
in interface SqlService
sqlRequest
- the sql requestException
- in case of any errorpublic SqlResult executeExplainPlan(SqlRequest sqlRequest) throws Exception
SqlService
executeExplainPlan
in interface SqlService
sqlRequest
- the sql requestException
- in case of any errorpublic SqlResult executeExternal(SqlRequest sqlRequest) throws Exception
SqlService
executeExternal
in interface SqlService
sqlRequest
- the sql requestException
- in case of any errorpublic SqlResult executeScript(SqlRequest sqlRequest) throws Exception
SqlService
executeScript
in interface SqlService
sqlRequest
- the sql requestException
- in case of any errorpublic SqlResult executeSql(SqlRequest sqlRequest) throws Exception
SqlService
executeSql
in interface SqlService
sqlRequest
- the sql requestException
- in case of any errorpublic LogNode getLogNode(String m, Object ret, Object[] args, Throwable ex)
Loggable
getLogNode
in interface Loggable
m
- the methodret
- the return valueargs
- the input argumentex
- the exceptionpublic Map<String,FieldDef> getMetaData(SqlRequest sqlRequest) throws Exception
SqlService
getMetaData
in interface SqlService
sqlRequest
- the sql requestException
- the exceptionpublic String getPropertyName()
Loggable
getPropertyName
in interface Loggable
public boolean isLogByDefault()
Loggable
isLogByDefault
in interface Loggable
public void releaseConnection(SessionConnectionProvider<Alias> provider, Alias params) throws Exception
SqlService
releaseConnection
in interface SqlService
provider
- the connection providerparams
- the aliasException
- in case of any errorpublic void rollbackTransaction(SessionConnectionProvider<Alias> provider, Alias params, boolean closeOnRollback) throws Exception
SqlService
rollbackTransaction
in interface SqlService
provider
- the connection providerparams
- the aliascloseOnRollback
- the close on rollback flag. If set the connection will be closed on rollbackException
- in case of any errorCopyright © 2010-2020 Toolsverse. All Rights Reserved.