public class FirebirdDictionary extends DBDictionary
DBDictionary.DateMillisecondBehaviors, DBDictionary.SerializedData
Modifier and Type | Field and Description |
---|---|
protected String |
alterSequenceSQL |
protected String |
alterSequenceSQLFB15 |
protected String |
alterSequenceSQLFB20 |
protected String |
createSequenceSQL |
protected String |
createSequenceSQLFB15 |
protected String |
createSequenceSQLFB20 |
protected String |
dropSequenceSQLFB15 |
static int |
FB_VERSION_15 |
static int |
FB_VERSION_20 |
static int |
FB_VERSION_21 |
int |
firebirdVersion |
int |
indexedVarcharMaxSizeFB15 |
protected long |
maxRowNumberInRange |
static String |
RANGE_SYNTAX_FIRST_SKIP |
static String |
RANGE_SYNTAX_ROWS |
String |
rangeSyntax |
_proxyManager, allowQueryTimeoutOnFindUpdate, allowsAliasInBulkClause, arrayTypeName, autoAssignClause, autoAssignTypeName, batchLimit, bigintTypeName, binaryTypeName, bitLengthFunction, bitTypeName, blobBufferSize, blobTypeName, booleanRepresentation, booleanTypeName, castFunction, catalogSeparator, CENTI, characterColumnSize, charTypeName, clobBufferSize, clobTypeName, closePoolSQL, concatenateDelimiter, concatenateFunction, conf, connected, CONS_NAME_AFTER, CONS_NAME_BEFORE, CONS_NAME_MID, constraintNameMode, createPrimaryKeys, crossJoinClause, currentDateFunction, currentTimeFunction, currentTimestampFunction, databaseProductName, databaseProductVersion, datePrecision, dateTypeName, DECI, decimalTypeName, defaultSchemaName, delimitedCase, disableAlterSeqenceIncrementBy, disableSchemaFactoryColumnTypeErrors, distinctCountColumnSeparator, distinctTypeName, doubleTypeName, driverVendor, dropTableSQL, fixedSizeTypeNames, fixedSizeTypeNameSet, floatTypeName, forUpdateClause, fullResultCollectionInOrderByRelation, getStringVal, inClauseLimit, initializationSQL, innerJoinClause, integerTypeName, invalidColumnWordSet, isJDBC3, isJDBC4, javaObjectTypeName, joinSyntax, lastGeneratedKeyQuery, leadingDelimiter, log, longVarbinaryTypeName, longVarcharTypeName, maxAutoAssignNameLength, maxColumnNameLength, maxConstraintNameLength, maxEmbeddedBlobSize, maxEmbeddedClobSize, maxIndexesPerTable, maxIndexNameLength, maxTableNameLength, MICRO, MILLI, NAME_ANY, NAME_SEQUENCE, NAME_TABLE, nameConcatenator, NANO, nativeSequenceType, nextSequenceQuery, NO_BATCH, nullTypeName, numericTypeName, otherTypeName, outerJoinClause, platform, RANGE_POST_DISTINCT, RANGE_POST_LOCK, RANGE_POST_SELECT, RANGE_PRE_DISTINCT, rangePosition, realTypeName, refTypeName, reportsSuccessNoInfoOnBatchUpdates, requiresAliasForSubselect, requiresAutoCommitForMetaData, requiresCastForComparisons, requiresCastForMathFunctions, requiresConditionForCrossJoin, requiresSearchStringEscapeForLike, requiresTargetForDelete, reservedWords, reservedWordSet, roundTimeToMillisec, SCHEMA_CASE_LOWER, SCHEMA_CASE_PRESERVE, SCHEMA_CASE_UPPER, schemaCase, searchStringEscape, SEC, selectWords, selectWordSet, sequenceNameSQL, sequenceSchemaSQL, sequenceSQL, setStringRightTruncationOn, simulateLocking, smallintTypeName, sqlStateCodes, storageLimitationsFatal, storeCharsAsNumbers, storeLargeNumbersAsStrings, stringLengthFunction, structTypeName, substringFunctionName, supportsAlterTableWithAddColumn, supportsAlterTableWithDropColumn, supportsAutoAssign, supportsCascadeDeleteAction, supportsCascadeUpdateAction, supportsCaseConversionForLob, supportsComments, supportsCorrelatedSubselect, supportsDefaultDeleteAction, supportsDefaultUpdateAction, supportsDeferredConstraints, supportsDelimitedIdentifiers, supportsForeignKeys, supportsForeignKeysComposite, supportsGeneralCaseExpression, supportsGetGeneratedKeys, supportsHaving, supportsLockingWithDistinctClause, supportsLockingWithInnerJoin, supportsLockingWithMultipleTables, supportsLockingWithOrderClause, supportsLockingWithOuterJoin, supportsLockingWithSelectRange, supportsModOperator, supportsMultipleNontransactionalResultSets, supportsNullDeleteAction, supportsNullTableForGetColumns, supportsNullTableForGetImportedKeys, supportsNullTableForGetIndexInfo, supportsNullTableForGetPrimaryKeys, supportsNullUniqueColumn, supportsNullUpdateAction, supportsParameterInSelect, supportsQueryTimeout, supportsRestrictDeleteAction, supportsRestrictUpdateAction, supportsSchemaForGetColumns, supportsSchemaForGetTables, supportsSelectEndIndex, supportsSelectForUpdate, supportsSelectFromFinalTable, supportsSelectStartIndex, supportsSimpleCaseExpression, supportsSubselect, supportsUniqueConstraints, supportsXMLColumn, systemSchemas, systemSchemaSet, systemTables, systemTableSet, tableForUpdateClause, tableLengthIncludesSchema, tableTypes, timestampTypeName, timeTypeName, tinyintTypeName, toLowerCaseFunction, toUpperCaseFunction, trailingDelimiter, trimBothFunction, trimLeadingFunction, trimSchemaName, trimStringColumns, trimTrailingFunction, typeModifierSet, UNLIMITED, useGetBestRowIdentifierForPrimaryKeys, useGetBytesForBlobs, useGetObjectForBlobs, useGetStringForClobs, useJDBC4SetBinaryStream, useNativeSequenceCache, useSchemaName, useSetBytesForBlobs, useSetStringForClobs, useWildCardForCount, validationSQL, varbinaryTypeName, varcharTypeName, VENDOR_DATADIRECT, VENDOR_OTHER, xmlTypeEncoding, xmlTypeName
SYNTAX_DATABASE, SYNTAX_SQL92, SYNTAX_TRADITIONAL
Constructor and Description |
---|
FirebirdDictionary() |
Modifier and Type | Method and Description |
---|---|
protected void |
appendSelectRange(SQLBuffer buf,
long start,
long end,
boolean subselect)
Use either
FIRST <p> SKIP <q> or
ROWS <m> TO <n> syntax. |
protected String |
appendSize(Column col,
String typeName)
On Firebird 1.5 reduce the size of indexed
VARCHAR column
to 252 or a value specified by user. |
void |
connectedConfiguration(Connection conn)
Determine Firebird version and configure itself accordingly.
|
protected int |
determineFirebirdVersion(Connection con)
Determine Firebird version either by using JDBC 3 methods or, if they
are not available, by parsing the value returned by
DatabaseMetaData.getDatabaseProductVersion().
|
protected void |
determineRangeSyntax()
Determine range syntax to be used depending on Firebird version.
|
protected String |
getColumnNameForMetadata(String columnName)
Return
% if columnName is null ,
otherwise delegate to super implementation. |
String[] |
getCreateSequenceSQL(Sequence seq)
Return either
CREATE SEQUENCE <sequence name> or
CREATE GENERATOR <sequence name> . |
String[] |
getDropColumnSQL(Column column)
Return
ALTER TABLE <table name> DROP <col name> . |
String[] |
getDropSequenceSQL(Sequence seq)
On Firebird 1.5 return
DROP GENERATOR <sequence name> . |
String |
getPlaceholderValueString(Column col)
Return
<value> AS <type> . |
protected String |
getSequencesSQL(DBIdentifier schemaName,
DBIdentifier sequenceName) |
protected String |
getSequencesSQL(String schemaName,
String sequenceName)
Return Firebird-specific statement to select the list of sequences.
|
protected String |
getTableNameForMetadata(DBIdentifier tableName)
Returns the table name that will be used for obtaining information
from
DatabaseMetaData . |
protected String |
getTableNameForMetadata(String tableName)
Return
% if tableName is null ,
otherwise delegate to super implementation. |
void |
indexOf(SQLBuffer buf,
FilterValue str,
FilterValue find,
FilterValue start)
On Firebird 2.1 return
POSITION(<find>, <str> [, <start>]) |
protected int |
matchErrorState(Map<Integer,Set<String>> errorStates,
SQLException ex)
Use error code as SQL state returned by Firebird is ambiguous.
|
protected Sequence |
newSequence(ResultSet sequenceMeta)
Call super implementation and trim sequence name.
|
void |
substring(SQLBuffer buf,
FilterValue str,
FilterValue start,
FilterValue length)
Use
SUBSTRING(<col name> FROM <m> FOR <n>) . |
addCastAsType, addErrorCode, appendCast, appendLength, appendNumericCast, appendSelect, appendUpdates, appendXmlComparison, applyRange, assertSupport, calculateValue, canOuterJoin, closeDataSource, combineForeignKey, comment, comparison, configureNamingRules, convertSchemaCase, convertSchemaCase, copy, copy, createIndexIfNecessary, createIndexIfNecessary, decorate, deleteStream, delimitAll, endConfiguration, executeQuery, fromDBName, getAddColumnSQL, getAddForeignKeySQL, getAddPrimaryKeySQL, getAlterSequenceSQL, getArray, getAsciiStream, getBatchFetchSize, getBatchLimit, getBatchUpdateCount, getBigDecimal, getBigInteger, getBinaryStream, getBlob, getBlobObject, getBoolean, getBooleanRepresentation, getByte, getBytes, getCalendar, getCastFunction, getCastFunction, getCatalogNameForMetadata, getCatalogNameForMetadata, getChar, getCharacterStream, getClob, getClobString, getColumnDBName, getColumnIdentifier, getColumnNameForMetadata, getColumns, getColumns, getConversionKey, getCreateIndexSQL, getCreateTableSQL, getCreateTableSQL, getDate, getDate, getDeclareColumnSQL, getDefaultIdentifierRule, getDefaultSchemaName, getDeleteTableContentsSQL, getDeleteTargets, getDelimitedCase, getDelimitIdentifiers, getDouble, getDropForeignKeySQL, getDropIndexSQL, getDropPrimaryKeySQL, getDropTableSQL, getFloat, getForeignKeyConstraintSQL, getForUpdateClause, getFrom, getFromSelect, getFullIdentifier, getFullName, getFullName, getFullName, getGeneratedKey, getGeneratedKeySequenceName, getGenKeySeqName, getIdentifierConcatenator, getIdentifierDelimiter, getIdentifierRule, getIdentifierRules, getIdentityColumnName, getImportedKeys, getImportedKeys, getImportedKeys, getImportedKeys, getIndexInfo, getIndexInfo, getInt, getInvalidColumnWordSet, getIsNotNullSQL, getIsNullSQL, getJDBCType, getJDBCType, getJDBCType, getKey, getLeadingDelimiter, getLOBStream, getLocale, getLog, getLong, getMajorVersion, getMarkerForInsertUpdate, getMillisecondBehavior, getMinorVersion, getNamingUtil, getNumber, getObject, getPreferredType, getPrimaryKeyConstraintSQL, getPrimaryKeys, getPrimaryKeys, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromBestRowIdentifier, getPrimaryKeysFromGetPrimaryKeys, getPrimaryKeysFromGetPrimaryKeys, getRef, getSchemaCase, getSchemaNameForMetadata, getSchemaNameForMetadata, getSelectOperation, getSelects, getSelectTableAliases, getSequence, getSequences, getSequences, getShort, getString, getSupportsDelimitedIdentifiers, getSupportsXMLColumn, getTables, getTables, getTime, getTimestamp, getTrailingDelimiter, getTrimSchemaName, getTypeName, getTypeName, getUniqueConstraintSQL, getValidColumnName, getValidColumnName, getValidColumnName, getValidColumnName, getValidForeignKeyName, getValidForeignKeyName, getValidIndexName, getValidIndexName, getValidPrimaryKeyName, getValidSequenceName, getValidSequenceName, getValidTableName, getValidTableName, getValidUniqueName, getValidUniqueName, getVersionColumn, getVersionColumn, getWhere, getXMLTypeEncoding, handleWarning, insertBlobForStreamingLoad, insertClobForStreamingLoad, insertSize, isFatalException, isImplicitJoin, isSelect, isSystemIndex, isSystemIndex, isSystemSequence, isSystemSequence, isSystemSequence, isSystemTable, isSystemTable, isUsingLimit, isUsingOffset, isUsingOrderBy, isUsingRange, makeNameValid, makeNameValid, makeNameValid, makeNameValid, mathFunction, needsToCreateIndex, needsToCreateIndex, newColumn, newForeignKey, newIndex, newPrimaryKey, newStoreException, newTable, prepareStatement, putBytes, putChars, putString, refSchemaComponents, serialize, setArray, setAsciiStream, setBatchLimit, setBigDecimal, setBigInteger, setBinaryStream, setBlob, setBlobObject, setBoolean, setBooleanRepresentation, setByte, setBytes, setCalendar, setChar, setCharacterStream, setClob, setClobString, setConfiguration, setDate, setDate, setDateMillisecondBehavior, setDefaultSchemaName, setDelimitedCase, setDelimitIdentifiers, setDouble, setFloat, setInt, setJoinSyntax, setLeadingDelimiter, setLocale, setLong, setMajorVersion, setMinorVersion, setNull, setNumber, setObject, setQueryTimeout, setRef, setShort, setStatementQueryTimeout, setString, setSupportsDelimitedIdentifiers, setSupportsXMLColumn, setTime, setTimeouts, setTimeouts, setTimestamp, setTrailingDelimiter, setTrimSchemaName, setTyped, setUnknown, setUnknown, setXMLTypeEncoding, shorten, startConfiguration, storageWarning, supportsDeferredForeignKeyConstraints, supportsDeferredUniqueConstraints, supportsDeleteAction, supportsIsolationForUpdate, supportsLocking, supportsRandomAccessResultSet, supportsUpdateAction, toBulkOperation, toDBName, toDBName, toDelete, toNativeJoin, toOperation, toOperation, toSelect, toSelect, toSelect, toSelect, toSelect, toSelectCount, toSQL92Join, toTraditionalJoin, toUpdate, updateBlob, updateClob, validateBatchProcess, validateDBSpecificBatchProcess, versionEqualOrEarlierThan, versionEqualOrLaterThan, versionLaterThan
public int firebirdVersion
public int indexedVarcharMaxSizeFB15
public String rangeSyntax
protected long maxRowNumberInRange
protected String alterSequenceSQLFB15
protected String alterSequenceSQLFB20
protected String createSequenceSQLFB15
protected String createSequenceSQLFB20
protected String dropSequenceSQLFB15
protected String alterSequenceSQL
protected String createSequenceSQL
public static final int FB_VERSION_15
public static final int FB_VERSION_20
public static final int FB_VERSION_21
public static final String RANGE_SYNTAX_FIRST_SKIP
public static final String RANGE_SYNTAX_ROWS
public void connectedConfiguration(Connection conn) throws SQLException
connectedConfiguration
in class DBDictionary
SQLException
protected void appendSelectRange(SQLBuffer buf, long start, long end, boolean subselect)
FIRST <p> SKIP <q>
or
ROWS <m> TO <n>
syntax. If ROWS
variant is used and end
equals Long.MAX_VALUE
, a
constant is used as <n>
value.appendSelectRange
in class DBDictionary
protected int determineFirebirdVersion(Connection con) throws SQLException
SQLException
protected void determineRangeSyntax()
public String getPlaceholderValueString(Column col)
<value> AS <type>
.getPlaceholderValueString
in class DBDictionary
protected String getTableNameForMetadata(String tableName)
%
if tableName
is null
,
otherwise delegate to super implementation.getTableNameForMetadata
in class DBDictionary
protected String getTableNameForMetadata(DBIdentifier tableName)
DBDictionary
DatabaseMetaData
.getTableNameForMetadata
in class DBDictionary
protected String getColumnNameForMetadata(String columnName)
%
if columnName
is null
,
otherwise delegate to super implementation.getColumnNameForMetadata
in class DBDictionary
public String[] getDropColumnSQL(Column column)
ALTER TABLE <table name> DROP <col name>
.getDropColumnSQL
in class DBDictionary
public String[] getCreateSequenceSQL(Sequence seq)
CREATE SEQUENCE <sequence name>
or
CREATE GENERATOR <sequence name>
.
If initial value of sequence is set, return also
an appropriate ALTER
statement.getCreateSequenceSQL
in class DBDictionary
protected String getSequencesSQL(String schemaName, String sequenceName)
getSequencesSQL
in class DBDictionary
protected String getSequencesSQL(DBIdentifier schemaName, DBIdentifier sequenceName)
getSequencesSQL
in class DBDictionary
protected Sequence newSequence(ResultSet sequenceMeta) throws SQLException
RDB$GENERATORS.RDB$GENERATOR_NAME
is CHAR(31)
and using RTRIM
UDF function on
Firebird 1.5 surprisingly returns a string right-padded with spaces up
to the length of 255.newSequence
in class DBDictionary
SQLException
public String[] getDropSequenceSQL(Sequence seq)
DROP GENERATOR <sequence name>
.
On Firebird 2.0 and later delegate to the super implementation.getDropSequenceSQL
in class DBDictionary
public void indexOf(SQLBuffer buf, FilterValue str, FilterValue find, FilterValue start)
POSITION(<find>, <str> [, <start>]).
On older versions throw UnsupportedException
- no suitable function exists.
indexOf
in class DBDictionary
buf
- the SQL buffer to write the indexOf invocation tostr
- a query value representing the target stringfind
- a query value representing the search stringstart
- a query value representing the start index, or null
to start at the beginningpublic void substring(SQLBuffer buf, FilterValue str, FilterValue start, FilterValue length)
SUBSTRING(<col name> FROM <m> FOR <n>)
.
Parameters are inlined because neither parameter binding nor expressions
are accepted by Firebird here. As a result, an
UnsupportedException
is thrown when something else than a
constant is used in start
or length
.substring
in class DBDictionary
buf
- the SQL buffer to write the substring invocation tostr
- a query value representing the target stringstart
- a query value representing the start indexlength
- a query value representing the length of substring, or null for noneprotected String appendSize(Column col, String typeName)
VARCHAR
column
to 252 or a value specified by user. 252 is the maximum Firebird 1.5 can
handle for one-column indexes. On Firebird 2.0 and later delegate to the
super implementation.appendSize
in class DBDictionary
protected int matchErrorState(Map<Integer,Set<String>> errorStates, SQLException ex)
matchErrorState
in class DBDictionary
errorStates
- classification of SQL error states by their specific nature. The keys of the
map represent one of the constants defined in StoreException
. The value corresponding to
a key represent the set of SQL Error States representing specific category of database error.
This supplied map is sourced from sql-error-state-codes.xml and filtered the
error states for the current database.
ex
- original SQL Exception as raised by the database driver.StoreException
.Copyright © 2006–2017 Apache Software Foundation. All rights reserved.