|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.rad.persist.jdbc.DBAccess
com.sibvisions.rad.persist.jdbc.MySQLDBAccess
public class MySQLDBAccess
The MySQLDBAccess is the implementation for MySQL databases.
DBAccess| Field Summary | |
|---|---|
static int |
TYPE_ENUM
the enum datatype. |
static int |
TYPE_SET
the set datatype. |
| Fields inherited from class com.sibvisions.rad.persist.jdbc.DBAccess |
|---|
LONGNVARCHAR, NCHAR, NCLOB, NVARCHAR, QUOTE, SQLXML |
| Constructor Summary | |
|---|---|
MySQLDBAccess()
Constructs a new MySQLDBAccess Object. |
|
| Method Summary | |
|---|---|
protected String[] |
extractValues(String pTypeDefinition)
Extracts the values from a valuelist, separated with ,. |
protected Hashtable<String,com.sibvisions.rad.persist.jdbc.MySQLDBAccess.ColumnInfo> |
getColumnInfo(String pTableName)
Get detailed column information for the given table. |
protected ServerColumnMetaData[] |
getColumnMetaDataIntern(String pFromClause,
String[] pQueryColumns,
String pBeforeQueryColumns,
String pWhereClause,
String pAfterWhereClause)
Returns the meta data information for the specified query, and configures all columns with defaults. |
protected Map<String,Object> |
getDefaultValuesIntern(String pCatalog,
String pSchema,
String pTable)
Gets all default column values of a specific table. |
protected List<ForeignKey> |
getForeignKeysIntern(String pCatalog,
String pSchema,
String pTable)
Returns all Foreign Keys for the specified table. |
protected Key |
getPrimaryKeyIntern(String pCatalog,
String pSchema,
String pTable)
It's gets all Primary Key columns and return it as String[]. |
protected TableInfo |
getTableInfoIntern(String pWriteBackTable)
Returns the meta data information for the specified query, and configures all columns with defaults. |
protected List<Key> |
getUniqueKeysIntern(String pCatalog,
String pSchema,
String pTable)
It gets all columns for each Unique Key and return it. |
boolean |
isAutoQuote(String pName)
It returns true if this name should be automated quoted. |
void |
open()
It opens the database and stores the Connection object. |
void |
setUsername(String pUsername)
Sets the user name to connect with. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int TYPE_ENUM
public static final int TYPE_SET
| Constructor Detail |
|---|
public MySQLDBAccess()
| Method Detail |
|---|
public void open()
throws DataSourceException
Connection object.
open in class DBAccessDataSourceException - if the database couldn't openedpublic boolean isAutoQuote(String pName)
DBAccess
isAutoQuote in class DBAccesspName - the name to quote.
protected ServerColumnMetaData[] getColumnMetaDataIntern(String pFromClause,
String[] pQueryColumns,
String pBeforeQueryColumns,
String pWhereClause,
String pAfterWhereClause)
throws DataSourceException
DBAccess
getColumnMetaDataIntern in class DBAccesspFromClause - the from clause with query tables and join definitionspQueryColumns - the query columnspBeforeQueryColumns - the before query columnspWhereClause - the last where condition in querypAfterWhereClause - the after where clause in query
DataSourceException - if an Exception occur during getting the meta data or
if the storage is not opened or
if one columns SQL type is not supported
protected TableInfo getTableInfoIntern(String pWriteBackTable)
throws DataSourceException
getTableInfoIntern in class DBAccesspWriteBackTable - the write back table to use for the isWriteable() state (Optional)
DataSourceException - if an Exception occur during getting the meta data or
if the storage is not opened or
if one columns SQL type is not supported
protected Key getPrimaryKeyIntern(String pCatalog,
String pSchema,
String pTable)
throws DataSourceException
getPrimaryKeyIntern in class DBAccesspCatalog - the catalog to usepSchema - the schema to usepTable - the table to use
DataSourceException - if an error occur during PK search process.
protected List<ForeignKey> getForeignKeysIntern(String pCatalog,
String pSchema,
String pTable)
throws DataSourceException
getForeignKeysIntern in class DBAccesspCatalog - the catalog to usepSchema - the schema to usepTable - the table to use as base table.
DataSourceException - if an error occur in determining the ForeignKeys.
protected List<Key> getUniqueKeysIntern(String pCatalog,
String pSchema,
String pTable)
throws DataSourceException
getUniqueKeysIntern in class DBAccesspCatalog - the catalog to usepSchema - the schema to usepTable - the table to use
DataSourceException - if an error occur during UK search process.
protected Map<String,Object> getDefaultValuesIntern(String pCatalog,
String pSchema,
String pTable)
throws DataSourceException
getDefaultValuesIntern in class DBAccesspCatalog - the catalog namepSchema - the schema namepTable - the table name
Hashtable with the column name as key and the default value as value. It only contains columns
with a default value
DataSourceException - if the database access throws an exceptionpublic void setUsername(String pUsername)
DBAccess
setUsername in class DBAccesspUsername - the user nameprotected Hashtable<String,com.sibvisions.rad.persist.jdbc.MySQLDBAccess.ColumnInfo> getColumnInfo(String pTableName)
pTableName - the name of the table
protected String[] extractValues(String pTypeDefinition)
,.
pTypeDefinition - the data type definition e.g. enum ('y', 'n')
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||