public class DBMSHandlerMySQL extends DBMSHandlerBase
Modifier and Type | Class and Description |
---|---|
static class |
DBMSHandlerMySQL.DBCommandMySQL
Defines the MySQL command type.
|
static class |
DBMSHandlerMySQL.DBSQLBuilderMySQL
Provides a DBSQLBuilder implementation for MySQL
|
DBMSHandlerBase.DBMSBuilder, DBMSHandlerBase.DBMSCommand, DBMSHandlerBase.DBSeqTable
DBMSHandler.DBSetGenKeys
GENERAL_SQL_KEYWORDS, ILLEGAL_NAME_CHARS, reservedSQLKeywords, SEQUENCE_NAME_SUFFIX
Constructor and Description |
---|
DBMSHandlerMySQL()
Constructor for the MySQL database dbms.
|
Modifier and Type | Method and Description |
---|---|
void |
attachDatabase(DBDatabase db,
Connection conn)
Called when a database is opened
|
DBCommandExpr |
createCombinedCommand(DBCommandExpr left,
String keyWord,
DBCommandExpr right)
This function gives the dbms a chance to provide a custom implementation
for a combined command such as UNION or INTERSECT
|
DBCommand |
createCommand(boolean autoPrepareStmt)
Creates a new MySQL command object.
|
DBSQLBuilder |
createSQLBuilder()
Creates a new MySQL SQL-Builder.
|
String |
getCharacterSet() |
String |
getConvertPhrase(DataType destType,
DataType srcType,
Object format)
Returns a data type convertion phrase template for this dbms
The returned template must contain a '?' |
String |
getDatabaseName()
returns the name for the database / schema
|
void |
getDDLScript(DBDDLGenerator.DDLActionType type,
DBObject dbo,
DBSQLScript script)
Appends the required DLL commands to create, drop or alter an object to the supplied DBDQLScript.
|
String |
getEngine()
Get the table engine that is used when creating new tables
|
Object |
getNextSequenceValue(DBDatabase db,
String seqName,
int minValue,
Connection conn)
Returns the next value of a named sequence The numbers are used for fields of type DBExpr.DT_AUTOINC.
|
DBColumnExpr |
getNextSequenceValueExpr(DBTableColumn column)
Returns an expression for creating a sequence value.
|
String |
getSequenceTableName()
returns the name of the sequence table
|
String |
getSQLPhrase(DBSqlPhrase phrase)
Gets an sql phrase template for this database system.
|
Timestamp |
getUpdateTimestamp(Connection conn)
Overridden.
|
boolean |
isSupported(DBMSFeature type)
Returns whether or not a particular feature is supported by this dbms
|
boolean |
isUseSequenceTable()
returns whether a sequence table is used for record identity management.
|
void |
setCharacterSet(String characterSet) |
void |
setDatabaseName(String databaseName)
Sets the name for the database / schema
This names is required for creating a database. |
void |
setEngine(String engine)
Set the table engine that is used when creating new tables
|
void |
setSequenceTableName(String sequenceTableName)
Sets the name of the sequence table.
|
void |
setUseSequenceTable(boolean useSequenceTable)
If set to true a special table is used for sequence number generation.
|
addStatementParam, appendEnableRelationStmt, appendObjectName, checkExists, closeResultSet, closeStatement, createModelChecker, createModelParser, detachDatabase, detectQuoteName, executeBatch, executeQuery, executeSQL, extractErrorMessage, getColumnAutoValue, getColumnSequenceName, getResultValue, prepareStatement, querySingleValue
public DBMSHandlerMySQL()
public String getDatabaseName()
public void setDatabaseName(String databaseName)
databaseName
- the name of the databasepublic String getCharacterSet()
public void setCharacterSet(String characterSet)
public String getEngine()
public void setEngine(String engine)
engine
- the table enginepublic boolean isUseSequenceTable()
public void setUseSequenceTable(boolean useSequenceTable)
useSequenceTable
- true to use a sequence table or false otherwise.public String getSequenceTableName()
public void setSequenceTableName(String sequenceTableName)
sequenceTableName
- the name of the table used for sequence number generationpublic void attachDatabase(DBDatabase db, Connection conn)
DBMSHandlerBase
attachDatabase
in interface DBMSHandler
attachDatabase
in class DBMSHandlerBase
public DBCommand createCommand(boolean autoPrepareStmt)
createCommand
in interface DBMSHandler
createCommand
in class DBMSHandlerBase
autoPrepareStmt
- flag whether to automatically provide literal values as prepared statement paramspublic DBSQLBuilder createSQLBuilder()
createSQLBuilder
in interface DBMSHandler
createSQLBuilder
in class DBMSHandlerBase
public DBCommandExpr createCombinedCommand(DBCommandExpr left, String keyWord, DBCommandExpr right)
DBMSHandlerBase
createCombinedCommand
in interface DBMSHandler
createCombinedCommand
in class DBMSHandlerBase
left
- the left commandkeyWord
- the key word (either "UNION" or "INTERSECT")public boolean isSupported(DBMSFeature type)
isSupported
in interface DBMSHandler
isSupported
in class DBMSHandlerBase
type
- type of requested feature. @see DBMSFeaturepublic String getSQLPhrase(DBSqlPhrase phrase)
phrase
- the identifier of the phraseDBMSHandler.getSQLPhrase(DBSqlPhrase)
public String getConvertPhrase(DataType destType, DataType srcType, Object format)
DBMSHandler
destType
- the target data typesrcType
- the source data typeformat
- additional formatting information (optional)DBMSHandler.getConvertPhrase(DataType, DataType, Object)
public Object getNextSequenceValue(DBDatabase db, String seqName, int minValue, Connection conn)
DBMSHandlerBase
getNextSequenceValue
in class DBMSHandlerBase
db
- the databaseseqName
- the name of the sequenceminValue
- the minimum value of the sequenceconn
- a valid database connectionDBMSHandlerBase.getNextSequenceValue(DBDatabase, String, int, Connection)
public DBColumnExpr getNextSequenceValueExpr(DBTableColumn column)
DBMSHandlerBase
getNextSequenceValueExpr
in class DBMSHandlerBase
column
- the column for which to obtain an expression providing the next sequence valueDBMSHandlerBase.getNextSequenceValueExpr(DBTableColumn col)
public Timestamp getUpdateTimestamp(Connection conn)
getUpdateTimestamp
in interface DBMSHandler
getUpdateTimestamp
in class DBMSHandlerBase
conn
- the connection that might be usedpublic void getDDLScript(DBDDLGenerator.DDLActionType type, DBObject dbo, DBSQLScript script)
DBMSHandler
type
- operation to perform (CREATE, DROP, ALTER)dbo
- the object for which to perform the operation (DBDatabase, DBTable, DBView, DBColumn, DBRelation)script
- the script to which to add the DDL command(s)DBMSHandler#getDDLScript(DDLActionType, DBObject, DBSQLScript)
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.