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.DBSeqTableDBMSHandler.DBSetGenKeysGENERAL_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, querySingleValuepublic 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)
DBMSHandlerBaseattachDatabase in interface DBMSHandlerattachDatabase in class DBMSHandlerBasedb - the databaseconn - the Jdbc connectionpublic DBCommand createCommand(boolean autoPrepareStmt)
createCommand in interface DBMSHandlercreateCommand in class DBMSHandlerBaseautoPrepareStmt - flag whether to automatically provide literal values as prepared statement paramspublic DBSQLBuilder createSQLBuilder()
createSQLBuilder in interface DBMSHandlercreateSQLBuilder in class DBMSHandlerBasepublic DBCommandExpr createCombinedCommand(DBCommandExpr left, String keyWord, DBCommandExpr right)
DBMSHandlerBasecreateCombinedCommand in interface DBMSHandlercreateCombinedCommand in class DBMSHandlerBaseleft - the left commandkeyWord - the key word (either "UNION" or "INTERSECT")right - the right commandpublic boolean isSupported(DBMSFeature type)
isSupported in interface DBMSHandlerisSupported in class DBMSHandlerBasetype - 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)
DBMSHandlerdestType - 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)
DBMSHandlerBasegetNextSequenceValue in class DBMSHandlerBasedb - 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)
DBMSHandlerBasegetNextSequenceValueExpr in class DBMSHandlerBasecolumn - the column for which to obtain an expression providing the next sequence valueDBMSHandlerBase.getNextSequenceValueExpr(DBTableColumn col)public Timestamp getUpdateTimestamp(Connection conn)
getUpdateTimestamp in interface DBMSHandlergetUpdateTimestamp in class DBMSHandlerBaseconn - the connection that might be usedpublic void getDDLScript(DBDDLGenerator.DDLActionType type, DBObject dbo, DBSQLScript script)
DBMSHandlertype - 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.