public abstract class SimpleDriver extends AbstractDriver
| Modifier and Type | Field and Description |
|---|---|
static String |
DEF_FUNCTION_CLASS
The default function class.
|
static String |
END_ON_EXCEPTION
The "end on exception" sql.
|
static String |
ON_EXCEPTION
The "on exception" sql.
|
ALLOWED_IDENT_CHARSBASE_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 |
|---|
SimpleDriver()
Instantiates a new simple driver.
|
| Modifier and Type | Method and Description |
|---|---|
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. |
void |
deleteStagingBinary(Connection conn,
String tableName)
Deletes staging table.
|
String |
filter(String value)
Filters string.
|
String |
getAddColumnSql()
Gets the ADD COLUMN SQL.
|
String |
getAlterTableAddColumnSql(String name,
FieldDef column,
FieldsRepository fieldsRepository)
Gets the alter table add column sql.
|
String |
getBegin()
Gets the "begin" sql statement.
|
String |
getBeginSplited()
Gets the "begin" token for splited sql.
|
Object |
getBlob(ResultSet rs,
int pos)
Gets the blob from the result set.
|
String |
getCallSql(String name)
Gets the "call" sql.
|
char |
getCharUsedForColumnsWithSpaces()
Gets the open and close char used for columns with spaces.
|
Object |
getClob(ResultSet rs,
int pos)
Gets the CLOB from the result set.
|
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 |
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 |
getDelimiter()
Gets the default delimiter.
|
TypedKeyValue<String,Integer> |
getDestinationInfo(String sql)
Gets the destination name and exception handler type from the sql.
|
String |
getDropSql(String type,
String name)
Gets the "drop" sql.
|
String |
getEnd()
Gets the "end" sql.
|
String |
getEndSplited()
Gets the "end" token for the splited sql statement.
|
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 |
getInitSql()
Gets the initialization sql.
|
int |
getLinesLimit()
Gets the maximum number of lines in the sql block supported by database.
|
int |
getMaxCharSize()
Gets the maximum character size.
|
int |
getMaxPrecision()
Gets the maximum precision.
|
int |
getMaxScale()
Gets the maximum scale.
|
int |
getMaxStringLiteralSize()
Gets the maximum string literal size.
|
int |
getMaxVarcharSize()
Gets the maximum varchar size.
|
String |
getMergeStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues,
String tableName,
String key)
Gets the merge statement.
|
String |
getMetadataSelectClause()
Gets the metadata "select" clause.
|
String |
getMetadataWhereClause()
Gets the metadata "where" clause.
|
Object |
getObject(ResultSet rs,
int index,
FieldDef fieldDef)
Gets the object from result set.
|
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.
|
Driver |
getParentDriver()
Gets the parent driver.
|
String |
getParentDriverName()
Gets the parent driver class name.
|
int |
getPrecision(int precision,
String type)
Gets the correct precision for the given type.
|
String |
getSafeDelimiter()
Gets the safe delimiter which can be added to any sql statetement.
|
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 |
getVarDeclare()
Gets the variable declare statement.
|
String |
getVarName(String name)
Gets the variable name.
|
int |
getWrongScale()
Gets the wrong scale.
|
boolean |
ignoreExceptionsDuringInit()
The "Ignore exceptions during initialization" flag.
|
boolean |
isMergeInNonCallableSupported()
Checks if "merge" statement can be not callable.
|
boolean |
needSeparateConnectionForDdl()
Check if driver requires separate connection for ddl statements.
|
String |
replaceOnException(String sql)
Replaces sql on exception.
|
boolean |
requiresRollbackAfterSqlError()
Returns true if database requires rollback after sql error.
|
void |
setBlob(PreparedStatement pstmt,
Object value,
int pos)
Sets the blob field.
|
void |
setClob(PreparedStatement pstmt,
Object value,
int pos)
Sets the clob field.
|
void |
setInitSql(String value)
Sets the initialization sql.
|
void |
setLinesLimit(int value)
Sets the maximum number of lines in the sql block supported by database.
|
void |
setMaxCharSize(int value)
Sets the maximum char size.
|
void |
setMaxPrecision(int value)
Sets the maximum precision.
|
void |
setMaxScale(int value)
Sets the maximum scale.
|
void |
setMaxStringLiteralSize(int value)
Sets the maximum string literal size.
|
void |
setMaxVarcharSize(int value)
Sets the maximum varchar size.
|
void |
setParentDriverName(String value)
Sets the parent driver class name.
|
boolean |
supportsAnonymousBlocks()
"Supports anonymous blocks" flag.
|
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 |
supportsParamsInAnonymousBlocks()
"Supports parameters in anonymous blocks" flag.
|
boolean |
supportsRollbackAfterDDL()
"Supports rollback after ddl" flag.
|
void |
updateStagingBlob(Connection conn,
Variable var,
String pkValue,
Object value)
Updates staging blob.
|
void |
updateStagingClob(Connection conn,
Variable var,
String pkValue,
Object value)
Updates staging clob.
|
Object |
value2StorageValue(int fieldType,
Object value,
Map<String,String> params,
boolean booleanToNumber)
Converts value for storage.
|
alwaysEncloseTableAndColumnsInQuotes, captureLog, compareTo, externalToolRequiresRedirect, getAllowedIdentifierChars, getAlterTableAddColumnSql, getAutotrace, getCaseSensitive, getCmdOptions, getColumns, getConfigFileName, getConnectionFile, getDefaultNull, getDeleteStatement, getDisplayName, getErrorLinePattern, getExtensionRank, getHome, getIdentifierName, getIdentifierName, getInsertStatement, getLicensePropertyName, getLocalUnitClassPath, getNativeType, getObjectCheckSql, getPostDeclareSql, getProperties, getSafeSql, getSelectStatement, getSqlForAutotrace, getSqlForExplainPlan, getSqlKeywordsFileName, getStartTransactionSql, getStringFieldSizeMultiplier, getTableName, getTablePrefixWhenAddingTable, getType, getUpdateStatement, isEqualDriver, requiresExecuteQuery, requiresSeparateConnectionForIndexes, setAlwaysEncloseTableAndColumnsInQuotes, setCaseSensitive, setStringFieldSizeMultiplier, setUpConnection, supportColonInFormatter, supportsAutotrace, supportsLogging, supportsNotNullable, supportsParallelExtract, supportsParallelLoad, supportsParentDriver, supportsPreparedStatement, supportsPreparedStatementInParallelThreads, supportsPreparedStatementInTransaction, tableName2Name, typeHasSizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdisableMetadataOnWrite, getCmdForExternalTool, getExplainPlan, getExternalToolName, getIoProcessorClassName, getJdbcDriverClassName, getMetadataClassName, getName, getPropsWizardResource, getSqlForExternalTool, getUrlPattern, ifDoesNotExistSql, ifExistsSql, openCloseConnectionOnDdl, requiresSemicolonInMerge, supportedJoinTypes, supportedSetOperations, supportsIndexes, supportsScriptsgetIconPath, getVendor, getVersion, getXmlConfigFileNamepublic static final String DEF_FUNCTION_CLASS
public static final String ON_EXCEPTION
public static final String END_ON_EXCEPTION
public String convertStringForStorage(String value)
Drivervalue - the valuepublic String getSafeDelimiter()
DrivergetSafeDelimiter in interface DrivergetSafeDelimiter in class AbstractDriverpublic String getDelimiter()
DrivergetDelimiter in interface DrivergetDelimiter in class AbstractDriverpublic String convertValueForStorage(Object fieldValue,
int fieldType,
boolean isFromTable)
DriverfieldType 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 void deleteStagingBinary(Connection conn,
String tableName)
throws Exception
Driverconn - the connectiontableName - the table nameException - in case of any errorpublic String filter(String value)
Driverfilter in interface Driverfilter in class AbstractDrivervalue - the valuepublic String getBegin()
Driverpublic String getBeginSplited()
Driverpublic Object getBlob(ResultSet rs,
int pos)
throws Exception
Driverrs - the result setpos - the position ofr the blob fieldException - in case of any errorpublic String getCallSql(String name)
Drivername - the name of the procedurepublic char getCharUsedForColumnsWithSpaces()
Driverpublic Object getClob(ResultSet rs,
int pos)
throws Exception
Driverrs - the result setpos - the position of the clob fieldException - in case of any errorpublic Driver getParentDriver()
DrivergetParentDriver in interface DrivergetParentDriver in class AbstractDriverpublic String getCreateTableSql(String name,
DataSet dataSet,
boolean isTemporary,
String key,
FieldsRepository fieldsRepository)
Drivername - the table namedataSet - the data setisTemporary - if true the table is temporarykey - the key field(s)fieldsRepository - the fields repositoryFieldsRepositorypublic String getAlterTableAddColumnSql(String name,
FieldDef column,
FieldsRepository fieldsRepository)
DrivergetAlterTableAddColumnSql in interface DrivergetAlterTableAddColumnSql in class AbstractDrivername - the namecolumn - the columnfieldsRepository - the fields repositorypublic String getCursorLoopEndSql(String name,
DataSet dataSet)
Drivername - the name of the cusrordataSet - the data setpublic String getCursorLoopStartSql(String name,
String cursorSql,
DataSet dataSet)
Drivername - the name of the cursorcursorSql - the cursor sqldataSet - the data setpublic String getCursorRecAccessSql(String fieldName)
DriverfieldName - the field namepublic String getDeclare()
Driverpublic String getDeclareCursorEndSql()
Driverpublic String getDeclareCursorSql(String sql,
String name,
String cursorSql,
DataSet dataSet)
Driversql - 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)
Driversql - the sqldataSet - the data setkey - the key field(s)fieldsRepository - the fields repositoryvariables - the variablesFieldsRepositorypublic String getDefaultFunctionClass()
DriverFunctionpublic String getDefaultType()
Driverpublic TypedKeyValue<String,Integer> getDestinationInfo(String sql)
Driversql - the sqlpublic String getDropSql(String type,
String name)
Drivertype - the object type. Possible values: PROC_TYPE, FUNC_TYPE,
DDL_TYPE, TABLE_TYPEname - the object namepublic String getEnd()
Driverpublic String getEndSplited()
Driverpublic String getIf()
Driverpublic String getIfBegin()
Driverpublic String getIfElse()
Driverpublic String getIfEnd()
Driverpublic String getInitSql()
Driverpublic int getLinesLimit()
Driverpublic int getMaxCharSize()
Driverpublic int getMaxPrecision()
Driverpublic int getMaxScale()
Driverpublic int getMaxStringLiteralSize()
Driverpublic int getMaxVarcharSize()
Driverpublic String getMergeStatement(TypedKeyValue<List<String>,List<Object>> fieldsAndValues, String tableName, String key)
DrivergetMergeStatement in interface DrivergetMergeStatement in class AbstractDriverfieldsAndValues - the fields and valuestableName - the table namekey - the key field(s)public String getMetadataSelectClause()
Driverpublic String getMetadataWhereClause()
Driverpublic Object getObject(ResultSet rs,
int index,
FieldDef fieldDef)
throws Exception
Driverrs - the result setindex - the index of the fieldfieldDef - the field typeException - in case of any errorpublic String getOnException(OnException onException)
DriveronException - the OnExceptionOnExceptionpublic String getOnExceptionBegin(OnException onException, long row)
DriveronException - the OnExceptionrow - the rowOnExceptionpublic String getOnExceptionEnd()
Driverpublic int getParamType(String type)
Drivertype - the output variable typepublic String getParentDriverName()
Driverpublic String getTempTableName(String name)
Drivername - the namepublic String getTopSelectClause(int top)
Drivertop - the maximum number of rows to selectpublic String getTopTrailClause(int top)
Drivertop - the maximum number of rows to selectpublic String getTopWhereClause(int top)
Drivertop - the maximum number of rows to selectpublic String getType(FieldDef fieldDef, String key, FieldsRepository fieldsRepository)
DriverfieldDef - the field definitionkey - the key field(s)fieldsRepository - the fields repositorypublic String getVarDeclare()
Driverpublic String getVarName(String name)
Drivername - the namepublic int getWrongScale()
Driverpublic boolean ignoreExceptionsDuringInit()
Driverpublic boolean isMergeInNonCallableSupported()
DriverisMergeInNonCallableSupported in interface DriverisMergeInNonCallableSupported in class AbstractDriverpublic boolean needSeparateConnectionForDdl()
DriverneedSeparateConnectionForDdl in interface DriverneedSeparateConnectionForDdl in class AbstractDriverpublic String replaceOnException(String sql)
Driversql - the sqlpublic boolean requiresRollbackAfterSqlError()
DriverrequiresRollbackAfterSqlError in interface DriverrequiresRollbackAfterSqlError in class AbstractDriverpublic void setBlob(PreparedStatement pstmt,
Object value,
int pos)
throws Exception
Driverpstmt - the prepared statementvalue - the valuepos - the position for the blob fieldException - in case of any errorpublic void setClob(PreparedStatement pstmt,
Object value,
int pos)
throws Exception
Driverpstmt - the prepared statementvalue - the valuepos - the position of the clob fieldException - in case of any errorpublic void setInitSql(String value)
Drivervalue - the new initialization sqlpublic void setLinesLimit(int value)
Drivervalue - the new lines limitpublic void setMaxCharSize(int value)
Drivervalue - the new maximum char sizepublic void setMaxPrecision(int value)
Drivervalue - the new maximum precisionpublic void setMaxScale(int value)
Drivervalue - the new maximum scalepublic void setMaxStringLiteralSize(int value)
Drivervalue - the new maximum string literal sizepublic void setMaxVarcharSize(int value)
Drivervalue - the new maximum varchar sizepublic void setParentDriverName(String value)
Drivervalue - the parent driver class namepublic boolean supportsAnonymousBlocks()
Driverpublic boolean supportsBinaryInProc()
Driverpublic boolean supportsCallableStatement()
Driverpublic boolean supportsExplainPlan()
Driverpublic boolean supportsExternalTool()
Driverpublic boolean supportsInnerFunctions()
Driverpublic boolean supportsParamsInAnonymousBlocks()
Driverpublic boolean supportsRollbackAfterDDL()
Driverpublic void updateStagingBlob(Connection conn,
Variable var,
String pkValue,
Object value)
throws Exception
Driverconn - the connectionvar - the variablepkValue - the primary key valuevalue - the valueException - in case of any errorpublic void updateStagingClob(Connection conn,
Variable var,
String pkValue,
Object value)
throws Exception
Driverconn - the connectionvar - the variablepkValue - the primary key valuevalue - the valueException - in case of any errorpublic Object value2StorageValue(int fieldType,
Object value,
Map<String,String> params,
boolean booleanToNumber)
DriverfieldType - the field type Typesvalue - the valueparams - the parametersbooleanToNumber - if true convert boolean true/false to 1/0public String getAddColumnSql()
DrivergetAddColumnSql in interface DrivergetAddColumnSql in class AbstractDriverpublic int getPrecision(int precision,
String type)
Driverprecision - the precisiontype - the typeCopyright © 2010-2020 Toolsverse. All Rights Reserved.