public interface Vendor
Modifier and Type | Field and Description |
---|---|
static Vendor |
HSQLDB |
static Vendor |
InterbaseOrFirebird |
static Vendor |
MSAccess |
static Vendor |
MySQL |
static Vendor |
Oracle |
static Vendor |
PostgreSQL |
static Vendor |
SQL92 |
static Vendor |
SQLServer |
Modifier and Type | Method and Description |
---|---|
void |
afterCancel(Connection connection)
Vendor-specific cleanup code to execute after statement cancel.
|
void |
afterClose(Connection connection)
Vendor-specific cleanup code to execute after statement close.
|
void |
afterQuery(Connection connection)
Vendor-specific code to execute after query execution.
|
void |
beforeCancel(Connection connection)
Vendor-specific cleanup code to execute prior to statement cancel.
|
void |
beforeClose(Connection connection)
Vendor-specific cleanup code to execute prior to statement close.
|
void |
beforeQuery(Connection connection)
Vendor-specific code to execute prior to query execution.
|
Expression |
booleanExpressionToSimpleExpression(Expression expression)
Turns a BOOLEAN expression into an expression that is guaranteed to
be usable in any place where an expression is allowed.
|
String |
getConcatenationExpression(String[] sqlFragments)
Concatenation of
a and b is
"a || b " in standard SQL, but CONCAT(a, b)
in MySQL. |
DataType |
getDataType(int jdbcType,
String name,
int size)
Returns a
DataType corresponding to a JDBC type. |
Properties |
getDefaultConnectionProperties()
Returns a set of default connection properties to be used
when connecting to this database engine type
|
String |
getRelationNameAliasExpression(RelationName relationName,
RelationName aliasName)
A relation name with an alias name for use in
FROM
clauses. |
Expression |
getRowNumLimitAsExpression(int limit)
Returns an expression for limiting the number of returned rows
for engines that support this (
ROWNUM <= n ) |
String |
getRowNumLimitAsQueryAppendage(int limit)
Returns a fragment to be appended to a SQL query in order to add a limit
to the number of returned rows for engines that support this (
LIMIT n ) |
String |
getRowNumLimitAsSelectModifier(int limit)
Returns a modifier for the SELECT keyword that adds a limit
to the number of returned rows for engines that support this (
TOP n ) |
void |
initializeConnection(Connection connection)
Vendor-specific initialization for a database connection.
|
boolean |
isIgnoredTable(String schema,
String table)
TODO Use the Filter interface for this
|
String |
quoteAttribute(Attribute attribute)
Handles special characters in attribute names.
|
String |
quoteBinaryLiteral(String hexString) |
String |
quoteDateLiteral(String date) |
String |
quoteIdentifier(String identifier)
Handles special characters in identifiers.
|
String |
quoteRelationName(RelationName relationName)
Handles special characters in relation names.
|
String |
quoteStringLiteral(String s)
Handles special characters in strings.
|
String |
quoteTimeLiteral(String time) |
String |
quoteTimestampLiteral(String timestamp) |
static final Vendor SQL92
static final Vendor MySQL
static final Vendor PostgreSQL
static final Vendor InterbaseOrFirebird
static final Vendor Oracle
static final Vendor SQLServer
static final Vendor MSAccess
static final Vendor HSQLDB
String getConcatenationExpression(String[] sqlFragments)
a
and b
is
"a || b
" in standard SQL, but CONCAT(a, b)
in MySQL.sqlFragments
- An array of SQL expressions to be concatenatedString getRelationNameAliasExpression(RelationName relationName, RelationName aliasName)
FROM
clauses. Would return relation AS alias
for
SQL 92 (the AS is optional in SQL 92, but some engines require
it, while others don't understand it).relationName
- The original table namealiasName
- The alias for the table nameString quoteAttribute(Attribute attribute)
attribute
- An attribute name (column name)String quoteRelationName(RelationName relationName)
relationName
- A relation name (table name)String quoteIdentifier(String identifier)
identifier
- An identifier, such as a table or column nameString quoteStringLiteral(String s)
s
- An arbitrary character stringExpression getRowNumLimitAsExpression(int limit)
ROWNUM <= n
)limit
- A maximum number of rows, or Database.NO_LIMIT
Expression.TRUE
if not supported by the engineString getRowNumLimitAsSelectModifier(int limit)
TOP n
)limit
- A maximum number of rows, or Database.NO_LIMIT
String getRowNumLimitAsQueryAppendage(int limit)
LIMIT n
)limit
- A maximum number of rows, or Database.NO_LIMIT
Properties getDefaultConnectionProperties()
DataType getDataType(int jdbcType, String name, int size)
DataType
corresponding to a JDBC type. This may be
an unsupported datatype; in this case, its DataType.isUnsupported()
method will return true. null
will be returned if the vendor
code doesn't handle this datatype at all; that should generally be
considered a bug.jdbcType
- A java.sql.Types
constantname
- The type name, as reported by java.sql
metadata methods, normalized to uppercasesize
- Character size of the type, or 0 if not applicablenull
if the vendor code is brokenExpression booleanExpressionToSimpleExpression(Expression expression)
expression
- A boolean expressionboolean isIgnoredTable(String schema, String table)
schema
- A schema name, or null
for the connection's default schematable
- A table nametrue
if this is a system table that doesn't contain user/application datavoid initializeConnection(Connection connection) throws SQLException
connection
- SQLException
void beforeQuery(Connection connection) throws SQLException
connection
- SQLException
void afterQuery(Connection connection) throws SQLException
connection
- SQLException
void beforeClose(Connection connection) throws SQLException
connection
- SQLException
void afterClose(Connection connection) throws SQLException
connection
- SQLException
void beforeCancel(Connection connection) throws SQLException
connection
- SQLException
void afterCancel(Connection connection) throws SQLException
connection
- SQLException