public class MicrosoftSqlServerDialect extends JdbcDialectImpl
Dialect
for the Microsoft SQL Server
database.Dialect.DatabaseProduct, Dialect.Datatype
Modifier and Type | Field and Description |
---|---|
static JdbcDialectFactory |
FACTORY |
databaseProduct, permitsSelectNotInGroupBy, productVersion
Constructor and Description |
---|
MicrosoftSqlServerDialect(Connection connection)
Creates a MicrosoftSqlServerDialect.
|
Modifier and Type | Method and Description |
---|---|
String |
generateInline(List<String> columnNames,
List<String> columnTypes,
List<String[]> valueList)
Generates a SQL statement to represent an inline dataset.
|
void |
quoteBooleanLiteral(StringBuilder buf,
String value)
Appends to a buffer a boolean literal.
|
protected void |
quoteDateLiteral(StringBuilder buf,
String value,
Date date)
Helper method for
JdbcDialectImpl.quoteDateLiteral(StringBuilder, String) . |
protected void |
quoteTimestampLiteral(StringBuilder buf,
String value,
Timestamp timestamp) |
boolean |
requiresAliasForFromQuery()
Returns whether this Dialect requires subqueries in the FROM clause
to have an alias.
|
boolean |
requiresUnionOrderByOrdinal()
Returns true if this dialect allows only integers in the ORDER BY
clause of a UNION (or other set operation) query.
|
allowsAs, allowsCompoundCountDistinct, allowsCountDistinct, allowsCountDistinctWithOtherAggs, allowsDdl, allowsDialectSharing, allowsFromQuery, allowsJoinOn, allowsMultipleCountDistinct, allowsMultipleDistinctSqlMeasures, allowsOrderByAlias, allowsRegularExpressionInWhereClause, allowsSelectNotInGroupBy, appendHintsAfterFromClause, caseWhenElse, computeStatisticsProviders, deduceIdentifierQuoteString, deduceMaxColumnNameLength, deduceProductName, deduceProductVersion, deduceReadOnly, deduceSupportedResultSetStyles, deduceSupportsSelectNotInGroupBy, generateCountExpression, generateInlineForAnsi, generateInlineGeneric, generateOrderByNulls, generateOrderByNullsAnsi, generateOrderItem, generateRegularExpression, getDatabaseProduct, getMaxColumnNameLength, getProduct, getQuoteIdentifierString, getStatisticsProviders, getType, isDatabase, needsExponent, quote, quoteDateLiteral, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteNumericLiteral, quoteStringLiteral, quoteTimeLiteral, quoteTimestampLiteral, requiresGroupByAlias, requiresHavingAlias, requiresOrderByAlias, requiresUnionOrderByExprToBeInSelectClause, supportsGroupByExpressions, supportsGroupingSets, supportsMultiValueInExpr, supportsResultSetConcurrency, supportsUnlimitedValueList, toString, toUpper
public static final JdbcDialectFactory FACTORY
public MicrosoftSqlServerDialect(Connection connection) throws SQLException
connection
- ConnectionSQLException
public String generateInline(List<String> columnNames, List<String> columnTypes, List<String[]> valueList)
Dialect
For example, for Oracle, generates
SELECT 1 AS FOO, 'a' AS BAR FROM dual UNION ALL SELECT 2 AS FOO, 'b' AS BAR FROM dual
For ANSI SQL, generates:
VALUES (1, 'a'), (2, 'b')
generateInline
in interface Dialect
generateInline
in class JdbcDialectImpl
columnNames
- List of column namescolumnTypes
- List of column types ("String" or "Numeric")valueList
- List of rows valuespublic boolean requiresAliasForFromQuery()
Dialect
requiresAliasForFromQuery
in interface Dialect
requiresAliasForFromQuery
in class JdbcDialectImpl
Dialect.allowsFromQuery()
public boolean requiresUnionOrderByOrdinal()
Dialect
For example,
SELECT x, y + z FROM t
is allowed but
UNION ALL
SELECT x, y + z FROM t
ORDER BY 1, 2SELECT x, y, z FROM t
is not.
UNION ALL
SELECT x, y, z FROM t
ORDER BY x
Teradata is an example of a dialect with this restriction.
requiresUnionOrderByOrdinal
in interface Dialect
requiresUnionOrderByOrdinal
in class JdbcDialectImpl
public void quoteBooleanLiteral(StringBuilder buf, String value)
Dialect
In the default dialect, boolean literals are printed as is.
quoteBooleanLiteral
in interface Dialect
quoteBooleanLiteral
in class JdbcDialectImpl
buf
- Buffer to append tovalue
- Literalprotected void quoteDateLiteral(StringBuilder buf, String value, Date date)
JdbcDialectImpl
JdbcDialectImpl.quoteDateLiteral(StringBuilder, String)
.quoteDateLiteral
in class JdbcDialectImpl
buf
- Buffer to append tovalue
- Value as stringdate
- Value as dateprotected void quoteTimestampLiteral(StringBuilder buf, String value, Timestamp timestamp)
quoteTimestampLiteral
in class JdbcDialectImpl
Copyright © 2019 Hitachi Vantara. All rights reserved.