net.sf.saffron.sql
Class SqlDialect
java.lang.Object
|
+--net.sf.saffron.sql.SqlDialect
- public class SqlDialect
- extends Object
SqlDialect
encapsulates the differences between dialects of
SQL, for the benefit of a SqlWriter
.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
databaseProductName
String databaseProductName
identifierQuoteString
String identifierQuoteString
SqlDialect
public SqlDialect(DatabaseMetaData databaseMetaData)
- Creates a
SqlDialect
- Parameters:
databaseMetaData
- used to determine which dialect of SQL to
generate
isAccess
public boolean isAccess()
isOracle
public boolean isOracle()
isPostgres
public boolean isPostgres()
quoteIdentifier
public String quoteIdentifier(String val)
- Encloses an identifier in quotation marks appropriate for the current
SQL dialect. For example,
quoteIdentifier("emp")
yields a
string containing "emp"
in Oracle, and a string
containing [emp]
in Access.
quoteStringLiteral
public String quoteStringLiteral(String val)
- Converts a string into a string literal. For example,
can't
run
becomes 'can''t run'
.
allowsAs
protected boolean allowsAs()
requiresAliasForFromItems
protected boolean requiresAliasForFromItems()