|
||||||||||
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.MySQL
public class MySQL
This syntax class implements MySQL-compatible SQL syntax.
Nested Class Summary | |
---|---|
static class |
MySQL.MySQLCompatibilityBitDataType
|
static class |
MySQL.MySQLCompatibilityDateDataType
|
static class |
MySQL.MySQLCompatibilityTimeDataType
|
static class |
MySQL.MySQLCompatibilityTimestampDataType
|
class |
MySQL.MySQLIdentifierParser
|
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 | |
---|---|
MySQL()
|
Method Summary | |
---|---|
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 |
getTrueTable()
For databases that support SQL queries without a FROM
clause, (SELECT 1+1 ), this should return null . |
Identifier[] |
parseIdentifiers(String s,
int minParts,
int maxParts)
Parses SQL identifiers, such as column names and table names. |
String |
quoteStringLiteral(String s)
Handles special characters in strings. |
String |
toString(Identifier identifier)
Handles special characters in identifiers. |
Methods inherited from class org.d2rq.db.vendor.SQL92 |
---|
booleanExpressionToSimpleExpression, getAliasOperator, getRowNumLimitAsExpression, getRowNumLimitAsQueryAppendage, getRowNumLimitAsSelectModifier, initializeConnection, isIgnoredTable, quoteBinaryLiteral, quoteDateLiteral, quoteTimeLiteral, quoteTimestampLiteral, toQualifiedTableName, toString, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MySQL()
Method Detail |
---|
public String getConcatenationExpression(String[] sqlFragments)
Vendor
a
and b
is
"a || b
" in standard SQL, but CONCAT(a, b)
in MySQL.
getConcatenationExpression
in interface Vendor
getConcatenationExpression
in class SQL92
sqlFragments
- An array of SQL expressions to be concatenated
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 Identifier[] parseIdentifiers(String s, int minParts, int maxParts) throws Identifier.IdentifierParseException
Vendor
MYCATALOG.MYSCHEMA."Table 1".ID
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 syntaxpublic String toString(Identifier identifier)
Vendor
toString
in interface Vendor
toString
in class SQL92
identifier
- An identifier, such as an unqualified table or column name
public String quoteStringLiteral(String s)
Vendor
quoteStringLiteral
in interface Vendor
quoteStringLiteral
in class SQL92
s
- An arbitrary character string
public Properties getDefaultConnectionProperties()
Vendor
getDefaultConnectionProperties
in interface Vendor
getDefaultConnectionProperties
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 broken
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |