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_TYPEAPP, 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, waitconvertStringForStorage, 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, value2StorageValuegetIconPath, getVendor, getVersion, getXmlConfigFileNamepublic static Set<Character> ALLOWED_IDENT_CHARS
public static String getCmdOptions(Alias alias)
alias - the aliaspublic Object captureLog(Connection con)
throws Exception
DrivercaptureLog in interface Drivercon - the connectionException - in case of any errorpublic int compareTo(ExtensionModule ext)
compareTo in interface Comparable<ExtensionModule>public boolean externalToolRequiresRedirect()
DriverexternalToolRequiresRedirect in interface Driverpublic String filter(String value)
Driverpublic Set<Character> getAllowedIdentifierChars()
DrivergetAllowedIdentifierChars in interface Driverpublic Object getAutotrace(ObjectStorage storage, Connection connection, Alias alias, String sql)
DrivergetAutotrace in interface Driverstorage - the object storageconnection - the connectionalias - the aliassql - the sqlObjectStoragepublic int getCaseSensitive()
DrivergetCaseSensitive in interface Driverpublic String getConfigFileName()
ExtensionModulegetConfigFileName in interface ExtensionModulepublic TypedKeyValue<String,String> getConnectionFile(Alias alias)
DrivergetConnectionFile in interface Driveralias - the aliaspublic String getDefaultNull()
DrivergetDefaultNull in interface Driverpublic String getDeleteStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues, String tableName, String key)
DrivergetDeleteStatement in interface DriverfieldsAndValues - the fields and valuestableName - the table namekey - the key field(s)public String getDelimiter()
DrivergetDelimiter in interface Driverpublic String getSafeDelimiter()
DrivergetSafeDelimiter in interface Driverpublic String getDisplayName()
ExtensionModulegetDisplayName in interface ExtensionModulepublic String getErrorLinePattern()
DrivergetErrorLinePattern in interface Driverpublic int getExtensionRank()
ExtensionModulegetExtensionRank in interface ExtensionModulepublic String getHome(ObjectStorage storage)
DrivergetHome in interface Driverstorage - the object storageObjectStorageprotected String getIdentifierName(String name,
int size)
name - the namesize - the sizepublic String getIdentifierName(String name,
String type)
DrivergetIdentifierName in interface Drivername - 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)
DrivergetInsertStatement in interface DriverfieldsAndValues - the fields and valuestableName - the table namepublic String getLicensePropertyName()
ExtensionModulegetLicensePropertyName in interface ExtensionModulepublic String getLocalUnitClassPath()
ExtensionModulegetLocalUnitClassPath in interface ExtensionModuleUnitpublic String getMergeStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues, String tableName, String key)
DrivergetMergeStatement in interface DriverfieldsAndValues - the fields and valuestableName - the table namekey - the key field(s)public String getObjectCheckSql(String name)
DrivergetObjectCheckSql in interface Drivername - the namepublic String getPostDeclareSql()
DrivergetPostDeclareSql in interface Driverpublic String[] getProperties()
DrivergetProperties in interface Driverpublic String getSafeSql(String sql)
DriverFor example table abc does not exist delete from abc -- not safe EXECUTE IMMEDIATE 'delete from abc' -- safe
getSafeSql in interface Driversql - the namepublic String getSelectStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues, String tableName)
DrivergetSelectStatement in interface DriverfieldsAndValues - the fields and valuestableName - the table namepublic String getSqlForAutotrace(ObjectStorage storage, String sql)
DrivergetSqlForAutotrace in interface Driverstorage - the storagesql - the sqlpublic String getSqlForExplainPlan(String sql,
SqlParser parser)
DrivergetSqlForExplainPlan in interface Driversql - the original sqlparser - the sql parserpublic String getSqlKeywordsFileName()
DrivergetSqlKeywordsFileName in interface Driverpublic String getStartTransactionSql()
DrivergetStartTransactionSql in interface Driverpublic String getTableName(String name)
DrivergetTableName in interface Drivername - the namepublic String getTablePrefixWhenAddingTable(String tableName)
DrivergetTablePrefixWhenAddingTable in interface DrivertableName - the table namepublic String getType()
ExtensionModulegetType in interface ExtensionModulepublic String getNativeType(FieldDef fieldDef, String key, FieldsRepository fieldsRepository)
DrivergetNativeType in interface DriverfieldDef - the field definitionkey - the key field(s)fieldsRepository - the fields repositorypublic String getUpdateStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues, String tableName, String key)
DrivergetUpdateStatement in interface DriverfieldsAndValues - the fields and valuestableName - the table namekey - the key field(s)public boolean isEqualDriver(Driver driver)
DriverisEqualDriver in interface Driverdriver - the driverpublic boolean isMergeInNonCallableSupported()
DriverisMergeInNonCallableSupported in interface Driverpublic boolean needSeparateConnectionForDdl()
DriverneedSeparateConnectionForDdl in interface Driverpublic boolean requiresExecuteQuery()
DriverrequiresExecuteQuery in interface Driverpublic boolean requiresRollbackAfterSqlError()
DriverrequiresRollbackAfterSqlError in interface Driverpublic boolean requiresSeparateConnectionForIndexes()
DriverrequiresSeparateConnectionForIndexes in interface Driverpublic void setCaseSensitive(int value)
DriversetCaseSensitive in interface Drivervalue - the new case sensitive attribute. Possible values:
CASE_SENSITIVE_UNDEFINED, CASE_SENSITIVE_LOWER,
CASE_SENSITIVE_UPPERpublic void setUpConnection(Connection con,
boolean before)
throws Exception
DriversetUpConnection in interface Drivercon - the connectionbefore - if true method executed before script, false - afterException - in case of any errorpublic boolean supportColonInFormatter()
DriversupportColonInFormatter in interface Driverpublic String supportsAutotrace()
DriversupportsAutotrace in interface Driverpublic boolean supportsLogging()
DriversupportsLogging in interface Driverpublic boolean supportsNotNullable()
DriversupportsNotNullable in interface Driverpublic boolean supportsParallelExtract()
DriversupportsParallelExtract in interface Driverpublic boolean supportsParallelLoad()
DriversupportsParallelLoad in interface Driverpublic boolean supportsParentDriver()
DriversupportsParentDriver in interface Driverpublic String tableName2Name(String name)
DrivertableName2Name in interface Drivername - the table namepublic boolean typeHasSize(int type,
String nativeDataType)
Drivertrue if type has size. For example:
Types.VARCHAR has size, Types.INTEGER - doesn't.typeHasSize in interface Drivertype - the type TypesnativeDataType - the natice data typepublic boolean supportsPreparedStatementInTransaction()
DriversupportsPreparedStatementInTransaction in interface Driverpublic boolean supportsPreparedStatement()
DriversupportsPreparedStatement in interface Driverpublic boolean alwaysEncloseTableAndColumnsInQuotes()
DriveralwaysEncloseTableAndColumnsInQuotes in interface Driverpublic void setAlwaysEncloseTableAndColumnsInQuotes(boolean value)
DriversetAlwaysEncloseTableAndColumnsInQuotes in interface Drivervalue - the new always enclose table and columns in quotespublic boolean supportsPreparedStatementInParallelThreads()
DriversupportsPreparedStatementInParallelThreads in interface Driverpublic Driver getParentDriver()
DrivergetParentDriver in interface Driverpublic String getAddColumnSql()
DrivergetAddColumnSql in interface Driverpublic String getAlterTableAddColumnSql(String name,
FieldDef column,
FieldsRepository fieldsRepository)
DrivergetAlterTableAddColumnSql in interface Drivername - the namecolumn - the columnfieldsRepository - the fields repositorypublic String getAlterTableAddColumnSql(String name,
FieldDef column,
FieldsRepository fieldsRepository,
boolean withNotNull)
DrivergetAlterTableAddColumnSql in interface Drivername - the namecolumn - the columnfieldsRepository - the fields repositorywithNotNull - boolean, if true and the column is not nullable add NOT NULL
constraintpublic int getStringFieldSizeMultiplier()
DrivergetStringFieldSizeMultiplier in interface Driverpublic void setStringFieldSizeMultiplier(int multiplier)
DriversetStringFieldSizeMultiplier in interface Drivermultiplier - the new multiplierpublic String getColumns(String name,
DataSet dataSet,
String key,
FieldsRepository fieldsRepository)
DrivergetColumns in interface Drivername - the table namedataSet - the data setkey - the key field(s)fieldsRepository - the fields repositoryFieldsRepositoryCopyright © 2010-2020 Toolsverse. All Rights Reserved.