|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.d2rq.db.vendor.SQL92
org.d2rq.db.vendor.SQLServer
public class SQLServer
This syntax class implements SQL syntax for MS SQL Server and MS Access.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.d2rq.db.vendor.SQL92 |
---|
SQL92.IdentifierParser, SQL92.PatternDoublingQuoter, SQL92.Quoter |
Field Summary |
---|
Fields inherited from interface org.d2rq.db.vendor.Vendor |
---|
HSQLDB, InterbaseOrFirebird, log, MSAccess, MySQL, Oracle, PostgreSQL, SQL92, SQLServer, Sybase |
Constructor Summary | |
---|---|
SQLServer()
|
Method Summary | |
---|---|
DataType |
getDataType(int jdbcType,
String name,
int size)
Returns a DataType corresponding to a JDBC type. |
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 ) |
String |
getTrueTable()
For databases that support SQL queries without a FROM
clause, (SELECT 1+1 ), this should return null . |
boolean |
isIgnoredTable(String catalog,
String schema,
String table)
TODO Use the Filter interface for this |
Identifier[] |
parseIdentifiers(String s,
int minParts,
int maxParts)
Implements the special rules according to http://msdn.microsoft.com/en-us/library/ms175874.aspx |
String |
quoteBinaryLiteral(String hexString)
|
String |
quoteDateLiteral(String date)
|
String |
quoteTimeLiteral(String time)
|
String |
quoteTimestampLiteral(String timestamp)
|
Methods inherited from class org.d2rq.db.vendor.SQL92 |
---|
booleanExpressionToSimpleExpression, getAliasOperator, getConcatenationExpression, getDefaultConnectionProperties, getRowNumLimitAsExpression, initializeConnection, quoteStringLiteral, toQualifiedTableName, toString, toString, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SQLServer()
Method Detail |
---|
public String getTrueTable()
Vendor
FROM
clause, (SELECT 1+1
), this should return null
.
For databases that require some sort of dummy table (e.g., Oracle:
SELECT 1+1 FROM DUAL
), this should return the name of
that table.
getTrueTable
in interface Vendor
getTrueTable
in class SQL92
public String getRowNumLimitAsSelectModifier(int limit)
Vendor
TOP n
)
getRowNumLimitAsSelectModifier
in interface Vendor
getRowNumLimitAsSelectModifier
in class SQL92
limit
- A maximum number of rows, or Database.NO_LIMIT
public String getRowNumLimitAsQueryAppendage(int limit)
SQL92
getRowNumLimitAsQueryAppendage
in interface Vendor
getRowNumLimitAsQueryAppendage
in class SQL92
limit
- A maximum number of rows, or Database.NO_LIMIT
public String quoteBinaryLiteral(String hexString)
quoteBinaryLiteral
in interface Vendor
quoteBinaryLiteral
in class SQL92
public String quoteDateLiteral(String date)
quoteDateLiteral
in interface Vendor
quoteDateLiteral
in class SQL92
public String quoteTimeLiteral(String time)
quoteTimeLiteral
in interface Vendor
quoteTimeLiteral
in class SQL92
public String quoteTimestampLiteral(String timestamp)
quoteTimestampLiteral
in interface Vendor
quoteTimestampLiteral
in class SQL92
public DataType getDataType(int jdbcType, String name, int size)
Vendor
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.
getDataType
in interface Vendor
getDataType
in class SQL92
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 applicable
null
if the vendor code is brokenpublic boolean isIgnoredTable(String catalog, String schema, String table)
Vendor
isIgnoredTable
in interface Vendor
isIgnoredTable
in class SQL92
catalog
- A catalog name, or null
for the connection's default schemaschema
- A schema name, or null
for the connection's default schematable
- A table name
true
if this is a system table that doesn't contain user/application datapublic Identifier[] parseIdentifiers(String s, int minParts, int maxParts) throws Identifier.IdentifierParseException
parseIdentifiers
in interface Vendor
parseIdentifiers
in class SQL92
s
- The input stringminParts
- Minimum required identifiers, e.g., 1 for an unqualified identifiermaxParts
- Maximum required identifiers, e.g., 4 for a fully qualified column name
Identifier.IdentifierParseException
- on invalid syntax
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |