public abstract class AbstractDriver extends Object implements Driver
Modifier and Type | Field and Description |
---|---|
static Set<Character> |
ALLOWED_IDENT_CHARS
The ALLOWED identifier 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 |
---|
AbstractDriver() |
Modifier and Type | Method and Description |
---|---|
boolean |
alwaysEncloseTableAndColumnsInQuotes()
Check if system should always enclose table and columns in quotes.
|
Object |
captureLog(Connection con)
Capture database log, for example provided by Oracle dbms_output.put_line
|
int |
compareTo(ExtensionModule ext) |
boolean |
externalToolRequiresRedirect()
Checks if external tool requires redirect of the output to the file.
|
String |
filter(String value)
Filters string.
|
String |
getAddColumnSql()
Gets the ADD COLUMN SQL.
|
Set<Character> |
getAllowedIdentifierChars()
Gets the allowed identifier chars.
|
String |
getAlterTableAddColumnSql(String name,
FieldDef column,
FieldsRepository fieldsRepository)
Gets the alter table add column sql.
|
String |
getAlterTableAddColumnSql(String name,
FieldDef column,
FieldsRepository fieldsRepository,
boolean withNotNull)
Gets the alter table add column sql.
|
Object |
getAutotrace(ObjectStorage storage,
Connection connection,
Alias alias,
String sql)
Executes sql and produces real execution plan.
|
int |
getCaseSensitive()
Gets the "case sensitive" flag.
|
static String |
getCmdOptions(Alias alias)
Gets the command line options.
|
String |
getColumns(String name,
DataSet dataSet,
String key,
FieldsRepository fieldsRepository)
Gets the columns for "create table" sql.
|
String |
getConfigFileName()
Gets the path to the configuration file for the module.
|
TypedKeyValue<String,String> |
getConnectionFile(Alias alias)
Gets the connection aliases file for the database, for example
tnsnames.ora.
|
String |
getDefaultNull()
Gets the "default null" value.
|
String |
getDeleteStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues,
String tableName,
String key)
Gets the delete statement.
|
String |
getDelimiter()
Gets the default delimiter.
|
String |
getDisplayName()
Gets the display name.
|
String |
getErrorLinePattern()
Gets the "error line" pattern".
|
int |
getExtensionRank()
Gets the extension rank.
|
String |
getHome(ObjectStorage storage)
Gets the home folder for the native database client.
|
protected String |
getIdentifierName(String name,
int size)
Gets the identifier name.
|
String |
getIdentifierName(String name,
String type)
Gets the identifier name.
|
String |
getInsertStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues,
String tableName)
Gets the insert statement.
|
String |
getLicensePropertyName()
Gets the name of the license property.
|
String |
getLocalUnitClassPath()
If extension module is a "local" it must return the path to it's corresponding Unit.
|
String |
getMergeStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues,
String tableName,
String key)
Gets the merge statement.
|
String |
getNativeType(FieldDef fieldDef,
String key,
FieldsRepository fieldsRepository)
Gets the native field from native field type.
|
String |
getObjectCheckSql(String name)
Gets the sql used to check if object exists.
|
Driver |
getParentDriver()
Gets the parent driver.
|
String |
getPostDeclareSql()
This sql is added after all variables declared.
|
String[] |
getProperties()
Gets the properties.
|
String |
getSafeDelimiter()
Gets the safe delimiter which can be added to any sql statetement.
|
String |
getSafeSql(String sql)
Gets the safe sql.
|
String |
getSelectStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues,
String tableName)
Gets the select statement.
|
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 |
getSqlKeywordsFileName()
Gets the sql keywords file name.
|
String |
getStartTransactionSql()
Get start transaction sql.
|
int |
getStringFieldSizeMultiplier()
Gets the string field size multiplier.
|
String |
getTableName(String name)
Gets the table name.
|
String |
getTablePrefixWhenAddingTable(String tableName)
Gets the table prefix when adding table.
|
String |
getType()
Gets the type of the extension module.
|
String |
getUpdateStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues,
String tableName,
String key)
Gets the update statement.
|
boolean |
isEqualDriver(Driver driver)
Checks if given driver equals to this driver.
|
boolean |
isMergeInNonCallableSupported()
Checks if "merge" statement can be not callable.
|
boolean |
needSeparateConnectionForDdl()
Check if driver requires separate connection for ddl statements.
|
boolean |
requiresExecuteQuery()
Checks if driver requires to run as st.executeQuery() in some cases.
|
boolean |
requiresRollbackAfterSqlError()
Returns true if database requires rollback after sql error.
|
boolean |
requiresSeparateConnectionForIndexes()
Checks if driver requires separate connection for indexes.
|
void |
setAlwaysEncloseTableAndColumnsInQuotes(boolean value)
Sets the value of the flag "always enclose table and columns in quotes".
|
void |
setCaseSensitive(int value)
Sets the case sensitive attribute.
|
void |
setStringFieldSizeMultiplier(int multiplier)
Sets the sclale string field size.
|
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 |
supportsAutotrace()
Checks if driver supports autotrace.
|
boolean |
supportsLogging()
Checks if drivers supports database logging such as Oracle dbms_output.
|
boolean |
supportsNotNullable()
Checks is driver supports not nullable collumns.
|
boolean |
supportsParallelExtract()
"Supports parallel extract" flag.
|
boolean |
supportsParallelLoad()
"Supports parallel load" flag.
|
boolean |
supportsParentDriver()
Used internally to make a disition is it possible to use a generic jdbc
driver with a parent driver.
|
boolean |
supportsPreparedStatement()
Supports prepared statements.
|
boolean |
supportsPreparedStatementInParallelThreads()
Supports prepared statement in parallel threads.
|
boolean |
supportsPreparedStatementInTransaction()
Supports prepared statement in transaction.
|
String |
tableName2Name(String name)
Converts table name to name.
|
boolean |
typeHasSize(int type,
String nativeDataType)
Returns
true if type has size. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convertStringForStorage, convertValueForStorage, deleteStagingBinary, disableMetadataOnWrite, getBegin, getBeginSplited, getBlob, getCallSql, getCharUsedForColumnsWithSpaces, getClob, getCmdForExternalTool, getCreateTableSql, getCursorLoopEndSql, getCursorLoopStartSql, getCursorRecAccessSql, getDeclare, getDeclareCursorEndSql, getDeclareCursorSql, getDeclareCursorVarSql, getDefaultFunctionClass, getDefaultType, getDestinationInfo, getDropSql, getEnd, getEndSplited, getExplainPlan, getExternalToolName, getIf, getIfBegin, getIfElse, getIfEnd, getInitSql, getIoProcessorClassName, getJdbcDriverClassName, getLinesLimit, getMaxCharSize, getMaxPrecision, getMaxScale, getMaxStringLiteralSize, getMaxVarcharSize, getMetadataClassName, getMetadataSelectClause, getMetadataWhereClause, getName, getObject, getOnException, getOnExceptionBegin, getOnExceptionEnd, getParamType, getParentDriverName, getPrecision, getPropsWizardResource, getSqlForExternalTool, getTempTableName, getTopSelectClause, getTopTrailClause, getTopWhereClause, getType, getUrlPattern, getVarDeclare, getVarName, getWrongScale, ifDoesNotExistSql, ifExistsSql, ignoreExceptionsDuringInit, openCloseConnectionOnDdl, replaceOnException, requiresSemicolonInMerge, setBlob, setClob, setInitSql, setLinesLimit, setMaxCharSize, setMaxPrecision, setMaxScale, setMaxStringLiteralSize, setMaxVarcharSize, setParentDriverName, supportedJoinTypes, supportedSetOperations, supportsAnonymousBlocks, supportsBinaryInProc, supportsCallableStatement, supportsExplainPlan, supportsExternalTool, supportsIndexes, supportsInnerFunctions, supportsParamsInAnonymousBlocks, supportsRollbackAfterDDL, supportsScripts, updateStagingBlob, updateStagingClob, value2StorageValue
getIconPath, getVendor, getVersion, getXmlConfigFileName
public static Set<Character> ALLOWED_IDENT_CHARS
public static String getCmdOptions(Alias alias)
alias
- the aliaspublic Object captureLog(Connection con) throws Exception
Driver
captureLog
in interface Driver
con
- the connectionException
- in case of any errorpublic int compareTo(ExtensionModule ext)
compareTo
in interface Comparable<ExtensionModule>
public boolean externalToolRequiresRedirect()
Driver
externalToolRequiresRedirect
in interface Driver
public String filter(String value)
Driver
public Set<Character> getAllowedIdentifierChars()
Driver
getAllowedIdentifierChars
in interface Driver
public Object getAutotrace(ObjectStorage storage, Connection connection, Alias alias, String sql)
Driver
getAutotrace
in interface Driver
storage
- the object storageconnection
- the connectionalias
- the aliassql
- the sqlObjectStorage
public int getCaseSensitive()
Driver
getCaseSensitive
in interface Driver
public String getConfigFileName()
ExtensionModule
getConfigFileName
in interface ExtensionModule
public TypedKeyValue<String,String> getConnectionFile(Alias alias)
Driver
getConnectionFile
in interface Driver
alias
- the aliaspublic String getDefaultNull()
Driver
getDefaultNull
in interface Driver
public String getDeleteStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues, String tableName, String key)
Driver
getDeleteStatement
in interface Driver
fieldsAndValues
- the fields and valuestableName
- the table namekey
- the key field(s)public String getDelimiter()
Driver
getDelimiter
in interface Driver
public String getSafeDelimiter()
Driver
getSafeDelimiter
in interface Driver
public String getDisplayName()
ExtensionModule
getDisplayName
in interface ExtensionModule
public String getErrorLinePattern()
Driver
getErrorLinePattern
in interface Driver
public int getExtensionRank()
ExtensionModule
getExtensionRank
in interface ExtensionModule
public String getHome(ObjectStorage storage)
Driver
getHome
in interface Driver
storage
- the object storageObjectStorage
protected String getIdentifierName(String name, int size)
name
- the namesize
- the sizepublic String getIdentifierName(String name, String type)
Driver
getIdentifierName
in interface Driver
name
- the original object nametype
- the type. Possible values: PROC_TYPE, FUNC_TYPE, DDL_TYPE,
TABLE_TYPEpublic String getInsertStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues, String tableName)
Driver
getInsertStatement
in interface Driver
fieldsAndValues
- the fields and valuestableName
- the table namepublic String getLicensePropertyName()
ExtensionModule
getLicensePropertyName
in interface ExtensionModule
public String getLocalUnitClassPath()
ExtensionModule
getLocalUnitClassPath
in interface ExtensionModule
Unit
public String getMergeStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues, String tableName, String key)
Driver
getMergeStatement
in interface Driver
fieldsAndValues
- the fields and valuestableName
- the table namekey
- the key field(s)public String getObjectCheckSql(String name)
Driver
getObjectCheckSql
in interface Driver
name
- the namepublic String getPostDeclareSql()
Driver
getPostDeclareSql
in interface Driver
public String[] getProperties()
Driver
getProperties
in interface Driver
public 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
sql
- the namepublic String getSelectStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues, String tableName)
Driver
getSelectStatement
in interface Driver
fieldsAndValues
- the fields and valuestableName
- the table namepublic String getSqlForAutotrace(ObjectStorage storage, String sql)
Driver
getSqlForAutotrace
in interface Driver
storage
- the storagesql
- the sqlpublic String getSqlForExplainPlan(String sql, SqlParser parser)
Driver
getSqlForExplainPlan
in interface Driver
sql
- the original sqlparser
- the sql parserpublic String getSqlKeywordsFileName()
Driver
getSqlKeywordsFileName
in interface Driver
public String getStartTransactionSql()
Driver
getStartTransactionSql
in interface Driver
public String getTableName(String name)
Driver
getTableName
in interface Driver
name
- the namepublic String getTablePrefixWhenAddingTable(String tableName)
Driver
getTablePrefixWhenAddingTable
in interface Driver
tableName
- the table namepublic String getType()
ExtensionModule
getType
in interface ExtensionModule
public String getNativeType(FieldDef fieldDef, String key, FieldsRepository fieldsRepository)
Driver
getNativeType
in interface Driver
fieldDef
- the field definitionkey
- the key field(s)fieldsRepository
- the fields repositorypublic String getUpdateStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues, String tableName, String key)
Driver
getUpdateStatement
in interface Driver
fieldsAndValues
- the fields and valuestableName
- the table namekey
- the key field(s)public boolean isEqualDriver(Driver driver)
Driver
isEqualDriver
in interface Driver
driver
- the driverpublic boolean isMergeInNonCallableSupported()
Driver
isMergeInNonCallableSupported
in interface Driver
public boolean needSeparateConnectionForDdl()
Driver
needSeparateConnectionForDdl
in interface Driver
public boolean requiresExecuteQuery()
Driver
requiresExecuteQuery
in interface Driver
public boolean requiresRollbackAfterSqlError()
Driver
requiresRollbackAfterSqlError
in interface Driver
public boolean requiresSeparateConnectionForIndexes()
Driver
requiresSeparateConnectionForIndexes
in interface Driver
public void setCaseSensitive(int value)
Driver
setCaseSensitive
in interface Driver
value
- the new case sensitive attribute. Possible values:
CASE_SENSITIVE_UNDEFINED, CASE_SENSITIVE_LOWER,
CASE_SENSITIVE_UPPERpublic void setUpConnection(Connection con, boolean before) throws Exception
Driver
setUpConnection
in interface Driver
con
- the connectionbefore
- if true method executed before script, false - afterException
- in case of any errorpublic boolean supportColonInFormatter()
Driver
supportColonInFormatter
in interface Driver
public String supportsAutotrace()
Driver
supportsAutotrace
in interface Driver
public boolean supportsLogging()
Driver
supportsLogging
in interface Driver
public boolean supportsNotNullable()
Driver
supportsNotNullable
in interface Driver
public boolean supportsParallelExtract()
Driver
supportsParallelExtract
in interface Driver
public boolean supportsParallelLoad()
Driver
supportsParallelLoad
in interface Driver
public boolean supportsParentDriver()
Driver
supportsParentDriver
in interface Driver
public String tableName2Name(String name)
Driver
tableName2Name
in interface Driver
name
- the table namepublic 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
type
- the type Types
nativeDataType
- the natice data typepublic boolean supportsPreparedStatementInTransaction()
Driver
supportsPreparedStatementInTransaction
in interface Driver
public boolean supportsPreparedStatement()
Driver
supportsPreparedStatement
in interface Driver
public boolean alwaysEncloseTableAndColumnsInQuotes()
Driver
alwaysEncloseTableAndColumnsInQuotes
in interface Driver
public void setAlwaysEncloseTableAndColumnsInQuotes(boolean value)
Driver
setAlwaysEncloseTableAndColumnsInQuotes
in interface Driver
value
- the new always enclose table and columns in quotespublic boolean supportsPreparedStatementInParallelThreads()
Driver
supportsPreparedStatementInParallelThreads
in interface Driver
public Driver getParentDriver()
Driver
getParentDriver
in interface Driver
public String getAddColumnSql()
Driver
getAddColumnSql
in interface Driver
public String getAlterTableAddColumnSql(String name, FieldDef column, FieldsRepository fieldsRepository)
Driver
getAlterTableAddColumnSql
in interface Driver
name
- the namecolumn
- the columnfieldsRepository
- the fields repositorypublic String getAlterTableAddColumnSql(String name, FieldDef column, FieldsRepository fieldsRepository, boolean withNotNull)
Driver
getAlterTableAddColumnSql
in interface Driver
name
- the namecolumn
- the columnfieldsRepository
- the fields repositorywithNotNull
- boolean, if true and the column is not nullable add NOT NULL
constraintpublic int getStringFieldSizeMultiplier()
Driver
getStringFieldSizeMultiplier
in interface Driver
public void setStringFieldSizeMultiplier(int multiplier)
Driver
setStringFieldSizeMultiplier
in interface Driver
multiplier
- the new multiplierpublic String getColumns(String name, DataSet dataSet, String key, FieldsRepository fieldsRepository)
Driver
getColumns
in interface Driver
name
- the table namedataSet
- the data setkey
- the key field(s)fieldsRepository
- the fields repositoryFieldsRepository
Copyright © 2010-2020 Toolsverse. All Rights Reserved.