public class OracleDriver extends CallableDriver
Modifier and Type | Field and Description |
---|---|
static String |
AUTO_TRACE_PROP
The AUTO_TRACE property.
|
static String |
BEGIN
The BEGIN sql.
|
static String |
BEGIN_SPLITED
The BEGIN_SPLITED sql.
|
static String |
CURSOR
The CURSOR sql.
|
static String |
DECLARE
The DECLARE sql.
|
static String |
END
The END sql.
|
static String |
END_LOOP
The END_LOOP sql.
|
static String |
END_SPLITED
The END_SPLITED sql.
|
static String |
IF
The IF sql.
|
static String |
IF_BEGIN
The IF_BEGIN sql.
|
static String |
IF_ELSE
The IF_ELSE sql.
|
static String |
IF_END
The IF_END sql.
|
static String |
INIT_SQL
The INIT sql.
|
static int |
LINES_LIMIT
The maximum number of lines allowed in the sql block.
|
static int |
MAX_CHAR_SIZE
The maximum char size.
|
static int |
MAX_NUMBER_PREC_SIZE
The maximum precision size.
|
static int |
MAX_NUMBER_SCALE_SIZE
The maximum scale size.
|
static int |
MAX_STRING_LITERAL_SIZE
The maximum string literal size.
|
static int |
MAX_VARCHAR_SIZE
The maximum varchar size.
|
static String |
ON_EXCEPTION
The ON_EXCEPTION sql.
|
static String |
ON_EXCEPTION_BEGIN
The ON_EXCEPTION_BEGIN sql.
|
static String |
ON_EXCEPTION_END
The ON_EXCEPTION_END sql.
|
static int |
ORACLE_CURSOR_TYPE
The ORACLE_CURSOR_TYPE type.
|
static String |
ORACLE_DATE_FORMAT
The ORACLE DATE FORMAT.
|
static String |
ORACLE_HOME_PROP
The ORACLE client HOME property.
|
static String |
ORACLE_HOME_VAR
The ORACLE client HOME variable.
|
static String |
ORACLE_SERVICE_PROP
The ORACLE SERVICE property.
|
static String |
ORACLE_SID_PROP
The ORACLE SID property.
|
static String |
ORACLE_TIMESTAMP_FORMAT
The ORACLE TIMESTAMP FORMAT.
|
static String |
REC_ACCESS
The cursor record access sql.
|
static String |
START_LOOP
The START_LOOP sql.
|
ALLOWED_IDENT_CHARS
BASE_CLASS_PATH, CASE_SENSITIVE_LOWER, CASE_SENSITIVE_LOWER_STR, CASE_SENSITIVE_UNDEFINED, CASE_SENSITIVE_UPPER, CASE_SENSITIVE_UPPER_STR, CMD_OPTIONS_PARAM, DB_PARAM, DDL_TYPE, ETL_CODE, FUNC_TYPE, PROC_TYPE, SERVER_PARAM, TABLE_TYPE
APP, COMMAND, ETL_DRIVER, FORMATTER, IDE_NODE, NO_RANK, WIDGET
Constructor and Description |
---|
OracleDriver() |
Modifier and Type | Method and Description |
---|---|
protected String |
_getInitSql()
Gets init sql.
|
protected int |
_getLinesLimit()
Gets lines limit.
|
protected int |
_getMaxCharSize()
Gets max char size.
|
protected int |
_getMaxPrecision()
Gets max precision.
|
protected int |
_getMaxScale()
Gets the max scale.
|
protected int |
_getMaxStringLiteralSize()
Gets the max string literal size.
|
protected int |
_getMaxVarcharSize()
Gets the max varchar size.
|
Object |
captureLog(Connection con)
Capture database log, for example provided by Oracle dbms_output.put_line
|
String |
convertStringForStorage(String value)
Converts string so it can be used as s part of sql.
|
String |
convertValueForStorage(Object fieldValue,
int fieldType,
boolean isFromTable)
Converts value to string depending on
fieldType so it can be
used as s part of sql. |
String |
getAddColumnSql()
Gets the ADD COLUMN SQL.
|
String |
getBegin()
Gets the "begin" sql statement.
|
String |
getBeginSplited()
Gets the "begin" token for splited sql.
|
String |
getCallSql(String name)
Gets the "call" sql.
|
String |
getCmdForExternalTool(ObjectStorage storage,
Alias alias,
String sqlFile)
Gets the command line for the external tool.
|
TypedKeyValue<String,String> |
getConnectionFile(Alias alias)
Gets the connection aliases file for the database, for example
tnsnames.ora.
|
String |
getCreateTableSql(String name,
DataSet dataSet,
boolean isTemporary,
String key,
FieldsRepository fieldsRepository)
Gets the "create table" sql.
|
String |
getCursorLoopEndSql(String name,
DataSet dataSet)
Gets the "loop end" sql for the cursor.
|
String |
getCursorLoopStartSql(String name,
String cursorSql,
DataSet dataSet)
Gets the "loop start" sql for the cursor.
|
String |
getCursorRecAccessSql(String fieldName)
Gets the record access sql for the cursor.
|
String |
getCursorVarName(String fieldName)
Gets the cursor variable name.
|
static String |
getDbName(Alias alias)
Gets the database name.
|
String |
getDeclare()
Gets the "declare" sql.
|
String |
getDeclareCursorEndSql()
Gets the "declare cursor end" sql.
|
String |
getDeclareCursorSql(String sql,
String name,
String cursorSql,
DataSet dataSet)
Gets the "declare cursor" sql.
|
String |
getDeclareCursorVarSql(String sql,
DataSet dataSet,
String key,
FieldsRepository fieldsRepository,
Set<String> variables)
Gets the "declare cursor variable" sql.
|
String |
getDefaultFunctionClass()
Gets the default function class name.
|
String |
getDefaultType()
Gets the default database type.
|
String |
getDropSql(String type,
String name)
Gets the "drop" sql.
|
static String |
getEasyConnect(Alias alias)
Gets the easy connect string.
|
String |
getEnd()
Gets the "end" sql.
|
String |
getEndSplited()
Gets the "end" token for the splited sql statement.
|
String |
getErrorLinePattern()
Gets the "error line" pattern".
|
Object |
getExplainPlan(ObjectStorage storage,
Connection connection,
Alias alias,
String sql)
Gets the explain plan for the sql.
|
String |
getExternalToolName()
Gets the external tool name.
|
String |
getHome(ObjectStorage storage)
Gets the home folder for the native database client.
|
String |
getIconPath()
Gets the full path to the icon file.
|
String |
getIf()
Gets the "if" token.
|
String |
getIfBegin()
Gets the "if begin" token.
|
String |
getIfElse()
Gets the "if else" token.
|
String |
getIfEnd()
Gets the "if end" token.
|
String |
getJdbcDriverClassName()
Gets the jdbc driver class name.
|
String |
getLicensePropertyName()
Gets the name of the license property.
|
String |
getMergeStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues,
String tableName,
String key)
Gets the merge statement.
|
String |
getMetadataClassName()
Gets the metadata driver class name.
|
String |
getMetadataSelectClause()
Gets the metadata "select" clause.
|
String |
getMetadataWhereClause()
Gets the metadata "where" clause.
|
String |
getName()
Gets the name of the driver.
|
String |
getOnException(OnException onException)
Gets the "on exception" sql.
|
String |
getOnExceptionBegin(OnException onException,
long row)
Gets the "on exception begin" sql.
|
String |
getOnExceptionEnd()
Gets the "on exception end" sql.
|
int |
getParamType(String type)
Gets the parameter type from the output variable type.
|
String[] |
getProperties()
Gets the properties.
|
String |
getPropsWizardResource(String connectionDriver)
Gets the name of the xml file used to create a wizard for editing
properties.
|
static String |
getRole(Alias alias)
Gets the role.
|
String |
getSafeSql(String sql)
Gets the safe sql.
|
static String |
getServiceName(Alias alias)
Gets the service name or sid.
|
String |
getSqlForAutotrace(ObjectStorage storage,
String sql)
Gets the SQL for autotrace.
|
String |
getSqlForExplainPlan(String sql,
SqlParser parser)
Gets the sql for the explain plan.
|
String |
getSqlForExternalTool(Alias alias,
String sql,
SqlParser parser)
Gets the sql for external tool.
|
String |
getSqlKeywordsFileName()
Gets the sql keywords file name.
|
String |
getTempTableName(String name)
Gets the temporary table name.
|
String |
getTopSelectClause(int top)
Gets the "top select" clause.
|
String |
getTopTrailClause(int top)
Gets the "top trail" clause.
|
String |
getTopWhereClause(int top)
Gets the "top where" clause.
|
String |
getType(FieldDef fieldDef,
String key,
FieldsRepository fieldsRepository)
Gets the native field type.
|
String |
getUrlPattern()
Gets the jdbc driver url pattern.
|
String |
getVarDeclare()
Gets the variable declare statement.
|
String |
getVendor()
Gets the vendor.
|
String |
getVersion()
Gets the version of the extension module.
|
String |
getXmlConfigFileName()
Gets the path to the xml configuration file for the module.
|
boolean |
ignoreExceptionsDuringInit()
The "Ignore exceptions during initialization" flag.
|
boolean |
isMergeInNonCallableSupported()
Checks if "merge" statement can be not callable.
|
void |
setUpConnection(Connection con,
boolean before)
Set the up connection to enbale database logging, for example
dbms_output.enable()
|
boolean |
supportColonInFormatter()
Support colon in formatter.
|
String[] |
supportedJoinTypes()
Returns supported join types, such as inner join, left outer join etc.
|
String[] |
supportedSetOperations()
Returns names of the supported set operations, such as union, union all,
etc.
|
boolean |
supportsAnonymousBlocks()
"Supports anonymous blocks" flag.
|
String |
supportsAutotrace()
Checks if driver supports autotrace.
|
boolean |
supportsBinaryInProc()
"Supports binary data types in procedures" flag.
|
boolean |
supportsCallableStatement()
"Supports callable statement" flag.
|
boolean |
supportsExplainPlan()
"Supports explain plan" flag.
|
boolean |
supportsExternalTool()
"Supports external tool" flag.
|
boolean |
supportsInnerFunctions()
"Supports inner functions" flag.
|
boolean |
supportsLogging()
Checks if drivers supports database logging such as Oracle dbms_output.
|
boolean |
supportsParamsInAnonymousBlocks()
"Supports parameters in anonymous blocks" flag.
|
boolean |
supportsRollbackAfterDDL()
"Supports rollback after ddl" flag.
|
boolean |
typeHasSize(int type,
String nativeDataType)
Returns
true if type has size. |
deleteStagingBinary, getBlob, getCharUsedForColumnsWithSpaces, getClob, getDestinationInfo, getInitSql, getLinesLimit, getMaxCharSize, getMaxPrecision, getMaxScale, getMaxStringLiteralSize, getMaxVarcharSize, getObject, getParentDriverName, getVarName, getWrongScale, replaceOnException, setBlob, setClob, setInitSql, setLinesLimit, setMaxCharSize, setMaxPrecision, setMaxScale, setMaxStringLiteralSize, setMaxVarcharSize, setParentDriverName, supportsIndexes, supportsScripts, updateStagingBlob, updateStagingClob, value2StorageValue
alwaysEncloseTableAndColumnsInQuotes, compareTo, externalToolRequiresRedirect, filter, getAllowedIdentifierChars, getAlterTableAddColumnSql, getAlterTableAddColumnSql, getAutotrace, getCaseSensitive, getCmdOptions, getColumns, getConfigFileName, getDefaultNull, getDeleteStatement, getDelimiter, getDisplayName, getExtensionRank, getIdentifierName, getIdentifierName, getInsertStatement, getLocalUnitClassPath, getNativeType, getObjectCheckSql, getParentDriver, getPostDeclareSql, getSafeDelimiter, getSelectStatement, getStartTransactionSql, getStringFieldSizeMultiplier, getTableName, getTablePrefixWhenAddingTable, getType, getUpdateStatement, isEqualDriver, needSeparateConnectionForDdl, requiresExecuteQuery, requiresRollbackAfterSqlError, requiresSeparateConnectionForIndexes, setAlwaysEncloseTableAndColumnsInQuotes, setCaseSensitive, setStringFieldSizeMultiplier, supportsNotNullable, supportsParallelExtract, supportsParallelLoad, supportsParentDriver, supportsPreparedStatement, supportsPreparedStatementInParallelThreads, supportsPreparedStatementInTransaction, tableName2Name
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
disableMetadataOnWrite, getIoProcessorClassName, getPrecision, ifDoesNotExistSql, ifExistsSql, openCloseConnectionOnDdl, requiresSemicolonInMerge
public static final int ORACLE_CURSOR_TYPE
public static final String ORACLE_TIMESTAMP_FORMAT
public static final String ORACLE_DATE_FORMAT
public static final String ORACLE_HOME_VAR
public static final String ORACLE_SID_PROP
public static final String ORACLE_SERVICE_PROP
public static final String ORACLE_HOME_PROP
public static final String AUTO_TRACE_PROP
public static int MAX_STRING_LITERAL_SIZE
public static int MAX_VARCHAR_SIZE
public static int LINES_LIMIT
public static int MAX_CHAR_SIZE
public static int MAX_NUMBER_PREC_SIZE
public static int MAX_NUMBER_SCALE_SIZE
public static final String INIT_SQL
public static final String DECLARE
public static final String BEGIN
public static final String BEGIN_SPLITED
public static final String END
public static final String END_SPLITED
public static final String IF
public static final String IF_BEGIN
public static final String IF_ELSE
public static final String IF_END
public static final String ON_EXCEPTION_BEGIN
public static final String ON_EXCEPTION
public static final String ON_EXCEPTION_END
public static final String CURSOR
public static final String START_LOOP
public static final String END_LOOP
public static final String REC_ACCESS
public static String getDbName(Alias alias)
alias
- the aliaspublic static String getEasyConnect(Alias alias)
alias
- the aliaspublic static String getRole(Alias alias)
alias
- the aliaspublic static String getServiceName(Alias alias)
alias
- the aliasprotected String _getInitSql()
CallableDriver
_getInitSql
in class CallableDriver
protected int _getLinesLimit()
CallableDriver
_getLinesLimit
in class CallableDriver
protected int _getMaxCharSize()
CallableDriver
_getMaxCharSize
in class CallableDriver
protected int _getMaxPrecision()
CallableDriver
_getMaxPrecision
in class CallableDriver
protected int _getMaxScale()
CallableDriver
_getMaxScale
in class CallableDriver
protected int _getMaxStringLiteralSize()
CallableDriver
_getMaxStringLiteralSize
in class CallableDriver
protected int _getMaxVarcharSize()
CallableDriver
_getMaxVarcharSize
in class CallableDriver
public Object captureLog(Connection con) throws Exception
Driver
captureLog
in interface Driver
captureLog
in class AbstractDriver
con
- the connectionException
- in case of any errorpublic String convertStringForStorage(String value)
Driver
value
- the valuepublic String convertValueForStorage(Object fieldValue, int fieldType, boolean isFromTable)
Driver
fieldType
so it can be
used as s part of sql.fieldValue
- the field valuefieldType
- the field type Types
}isFromTable
- if true the value is coming from result set, otherwise - from
the database cursorpublic String getBegin()
Driver
public String getBeginSplited()
Driver
public String getCallSql(String name)
Driver
name
- the name of the procedurepublic String getCmdForExternalTool(ObjectStorage storage, Alias alias, String sqlFile)
Driver
storage
- the object storagealias
- the aliassqlFile
- the sql fileObjectStorage
public TypedKeyValue<String,String> getConnectionFile(Alias alias)
Driver
getConnectionFile
in interface Driver
getConnectionFile
in class AbstractDriver
alias
- the aliaspublic String getCreateTableSql(String name, DataSet dataSet, boolean isTemporary, String key, FieldsRepository fieldsRepository)
Driver
name
- the table namedataSet
- the data setisTemporary
- if true the table is temporarykey
- the key field(s)fieldsRepository
- the fields repositoryFieldsRepository
public String getCursorLoopEndSql(String name, DataSet dataSet)
Driver
name
- the name of the cusrordataSet
- the data setpublic String getCursorLoopStartSql(String name, String cursorSql, DataSet dataSet)
Driver
name
- the name of the cursorcursorSql
- the cursor sqldataSet
- the data setpublic String getCursorRecAccessSql(String fieldName)
Driver
fieldName
- the field namepublic String getCursorVarName(String fieldName)
fieldName
- the field namepublic String getDeclare()
Driver
public String getDeclareCursorEndSql()
Driver
public String getDeclareCursorSql(String sql, String name, String cursorSql, DataSet dataSet)
Driver
sql
- the sqlname
- the name of the cursorcursorSql
- the cursor sqldataSet
- the data setpublic String getDeclareCursorVarSql(String sql, DataSet dataSet, String key, FieldsRepository fieldsRepository, Set<String> variables)
Driver
sql
- the sqldataSet
- the data setkey
- the key field(s)fieldsRepository
- the fields repositoryvariables
- the variablesFieldsRepository
public String getDefaultFunctionClass()
Driver
Function
public String getDefaultType()
Driver
public String getDropSql(String type, String name)
Driver
type
- the object type. Possible values: PROC_TYPE, FUNC_TYPE,
DDL_TYPE, TABLE_TYPEname
- the object namepublic String getEnd()
Driver
public String getEndSplited()
Driver
public String getErrorLinePattern()
Driver
getErrorLinePattern
in interface Driver
getErrorLinePattern
in class AbstractDriver
public Object getExplainPlan(ObjectStorage storage, Connection connection, Alias alias, String sql)
Driver
storage
- the object storageconnection
- the connectionalias
- the aliassql
- the sqlObjectStorage
public String getExternalToolName()
Driver
public String getHome(ObjectStorage storage)
Driver
getHome
in interface Driver
getHome
in class AbstractDriver
storage
- the object storageObjectStorage
public String getIconPath()
ExtensionModule
public String getIf()
Driver
public String getIfBegin()
Driver
public String getIfElse()
Driver
public String getIfEnd()
Driver
public String getJdbcDriverClassName()
Driver
public String getLicensePropertyName()
ExtensionModule
getLicensePropertyName
in interface ExtensionModule
getLicensePropertyName
in class AbstractDriver
public String getMergeStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues, String tableName, String key)
Driver
getMergeStatement
in interface Driver
getMergeStatement
in class AbstractDriver
fieldsAndValues
- the fields and valuestableName
- the table namekey
- the key field(s)public String getMetadataClassName()
Driver
public String getMetadataSelectClause()
Driver
public String getMetadataWhereClause()
Driver
public String getName()
Driver
public String getOnException(OnException onException)
Driver
onException
- the OnExceptionOnException
public String getOnExceptionBegin(OnException onException, long row)
Driver
onException
- the OnExceptionrow
- the rowOnException
public String getOnExceptionEnd()
Driver
public int getParamType(String type)
Driver
type
- the output variable typepublic String[] getProperties()
Driver
getProperties
in interface Driver
getProperties
in class AbstractDriver
public String getPropsWizardResource(String connectionDriver)
Driver
connectionDriver
- the connection driverpublic String getSafeSql(String sql)
Driver
For example table abc does not exist delete from abc -- not safe EXECUTE IMMEDIATE 'delete from abc' -- safe
getSafeSql
in interface Driver
getSafeSql
in class AbstractDriver
sql
- the namepublic String getSqlForAutotrace(ObjectStorage storage, String sql)
Driver
getSqlForAutotrace
in interface Driver
getSqlForAutotrace
in class AbstractDriver
storage
- the storagesql
- the sqlpublic String getSqlForExplainPlan(String sql, SqlParser parser)
Driver
getSqlForExplainPlan
in interface Driver
getSqlForExplainPlan
in class AbstractDriver
sql
- the original sqlparser
- the sql parserpublic String getSqlForExternalTool(Alias alias, String sql, SqlParser parser)
Driver
alias
- the aliassql
- the original sqlparser
- the sql parserpublic String getSqlKeywordsFileName()
Driver
getSqlKeywordsFileName
in interface Driver
getSqlKeywordsFileName
in class AbstractDriver
public String getTempTableName(String name)
Driver
name
- the namepublic String getTopSelectClause(int top)
Driver
top
- the maximum number of rows to selectpublic String getTopTrailClause(int top)
Driver
top
- the maximum number of rows to selectpublic String getTopWhereClause(int top)
Driver
top
- the maximum number of rows to selectpublic String getType(FieldDef fieldDef, String key, FieldsRepository fieldsRepository)
Driver
fieldDef
- the field definitionkey
- the key field(s)fieldsRepository
- the fields repositorypublic String getUrlPattern()
Driver
public String getVarDeclare()
Driver
public String getVendor()
ExtensionModule
public String getVersion()
ExtensionModule
public String getXmlConfigFileName()
ExtensionModule
public boolean ignoreExceptionsDuringInit()
Driver
public boolean isMergeInNonCallableSupported()
Driver
isMergeInNonCallableSupported
in interface Driver
isMergeInNonCallableSupported
in class AbstractDriver
public void setUpConnection(Connection con, boolean before) throws Exception
Driver
setUpConnection
in interface Driver
setUpConnection
in class AbstractDriver
con
- the connectionbefore
- if true method executed before script, false - afterException
- in case of any errorpublic boolean supportColonInFormatter()
Driver
supportColonInFormatter
in interface Driver
supportColonInFormatter
in class AbstractDriver
public String[] supportedJoinTypes()
Driver
public String[] supportedSetOperations()
Driver
public boolean supportsAnonymousBlocks()
Driver
public String supportsAutotrace()
Driver
supportsAutotrace
in interface Driver
supportsAutotrace
in class AbstractDriver
public boolean supportsBinaryInProc()
Driver
public boolean supportsCallableStatement()
Driver
public boolean supportsExplainPlan()
Driver
public boolean supportsExternalTool()
Driver
public boolean supportsInnerFunctions()
Driver
public boolean supportsLogging()
Driver
supportsLogging
in interface Driver
supportsLogging
in class AbstractDriver
public boolean supportsParamsInAnonymousBlocks()
Driver
public boolean supportsRollbackAfterDDL()
Driver
public boolean typeHasSize(int type, String nativeDataType)
Driver
true
if type
has size. For example:
Types.VARCHAR has size, Types.INTEGER - doesn't.typeHasSize
in interface Driver
typeHasSize
in class AbstractDriver
type
- the type Types
nativeDataType
- the natice data typepublic String getAddColumnSql()
Driver
getAddColumnSql
in interface Driver
getAddColumnSql
in class AbstractDriver
Copyright © 2010-2020 Toolsverse. All Rights Reserved.