public class SQL92 extends Object implements Vendor
HSQLDB, InterbaseOrFirebird, MSAccess, MySQL, Oracle, PostgreSQL, SQL92, SQLServer| Constructor and Description |
|---|
SQL92(boolean useAS)
Initializes a new instance.
|
| 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)
In most databases, we don't have to do anything because boolean
expressions are allowed anywhere.
|
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)
Technically speaking, SQL 92 supports NO way of limiting
result sets (ROW_NUMBER appeared in SQL 2003).
|
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) |
public SQL92(boolean useAS)
useAS - Use "Table AS Alias" or "Table Alias" in FROM clauses? In standard SQL, either is fine.public String getConcatenationExpression(String[] sqlFragments)
Vendora and b is
"a || b" in standard SQL, but CONCAT(a, b)
in MySQL.getConcatenationExpression in interface VendorsqlFragments - An array of SQL expressions to be concatenatedpublic String getRelationNameAliasExpression(RelationName relationName, RelationName aliasName)
VendorFROM
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).getRelationNameAliasExpression in interface VendorrelationName - The original table namealiasName - The alias for the table namepublic String quoteAttribute(Attribute attribute)
VendorquoteAttribute in interface Vendorattribute - An attribute name (column name)public String quoteRelationName(RelationName relationName)
VendorquoteRelationName in interface VendorrelationName - A relation name (table name)public String quoteIdentifier(String identifier)
VendorquoteIdentifier in interface Vendoridentifier - An identifier, such as a table or column namepublic String quoteStringLiteral(String s)
VendorquoteStringLiteral in interface Vendors - An arbitrary character stringpublic String quoteBinaryLiteral(String hexString)
quoteBinaryLiteral in interface Vendorpublic String quoteDateLiteral(String date)
quoteDateLiteral in interface Vendorpublic String quoteTimeLiteral(String time)
quoteTimeLiteral in interface Vendorpublic String quoteTimestampLiteral(String timestamp)
quoteTimestampLiteral in interface Vendorpublic Expression getRowNumLimitAsExpression(int limit)
VendorROWNUM <= n)getRowNumLimitAsExpression in interface Vendorlimit - A maximum number of rows, or Database.NO_LIMITExpression.TRUE
if not supported by the enginepublic String getRowNumLimitAsQueryAppendage(int limit)
getRowNumLimitAsQueryAppendage in interface Vendorlimit - A maximum number of rows, or Database.NO_LIMITpublic String getRowNumLimitAsSelectModifier(int limit)
VendorTOP n)getRowNumLimitAsSelectModifier in interface Vendorlimit - A maximum number of rows, or Database.NO_LIMITpublic Properties getDefaultConnectionProperties()
VendorgetDefaultConnectionProperties in interface Vendorpublic DataType getDataType(int jdbcType, String name, int size)
VendorDataType 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.getDataType in interface VendorjdbcType - 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 brokenpublic Expression booleanExpressionToSimpleExpression(Expression expression)
booleanExpressionToSimpleExpression in interface Vendorexpression - A boolean expressionpublic boolean isIgnoredTable(String schema, String table)
VendorisIgnoredTable in interface Vendorschema - 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 datapublic void initializeConnection(Connection connection) throws SQLException
VendorinitializeConnection in interface VendorSQLExceptionpublic void beforeQuery(Connection connection) throws SQLException
VendorbeforeQuery in interface VendorSQLExceptionpublic void afterQuery(Connection connection) throws SQLException
VendorafterQuery in interface VendorSQLExceptionpublic void beforeClose(Connection connection) throws SQLException
VendorbeforeClose in interface VendorSQLExceptionpublic void afterClose(Connection connection) throws SQLException
VendorafterClose in interface VendorSQLExceptionpublic void beforeCancel(Connection connection) throws SQLException
VendorbeforeCancel in interface VendorSQLExceptionpublic void afterCancel(Connection connection) throws SQLException
VendorafterCancel in interface VendorSQLException