|
||||||||||
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
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.sibvisions.rad.persist.jdbc.DBAccess |
---|
DBAccess.ColumnMetaDataInfo |
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 |
---|
logger, 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. |
DBAccess.ColumnMetaDataInfo |
getColumnMetaData(String pFromClause,
String[] pQueryColumns,
String pBeforeQueryColumns,
String pWhereClause,
String pAfterWhereClause,
String pWritebackTable,
String[] pWritebackColumns)
Returns the meta data information for the specified query, and configures all columns with defaults. |
Hashtable<String,Object> |
getDefaultValues(String pCatalog,
String pSchema,
String pTable)
Gets all default column values of a specific table. |
List<ForeignKey> |
getFKs(String pCatalog,
String pSchema,
String pTable)
Returns all Foreign Keys for the specified table. |
Key |
getPK(String pCatalog,
String pSchema,
String pTable)
Gets all Primary Key columns and return it as list of Strings. |
List<Key> |
getUKs(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 DBAccess
DataSourceException
- if the database couldn't openedpublic boolean isAutoQuote(String pName)
DBAccess
isAutoQuote
in class DBAccess
pName
- the name to quote.
public DBAccess.ColumnMetaDataInfo getColumnMetaData(String pFromClause, String[] pQueryColumns, String pBeforeQueryColumns, String pWhereClause, String pAfterWhereClause, String pWritebackTable, String[] pWritebackColumns) throws DataSourceException
DBAccess
getColumnMetaData
in class DBAccess
pFromClause
- 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 querypWritebackTable
- the write back table to use for the isWriteable() state (Optional)pWritebackColumns
- the write back columns 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 supportedpublic Key getPK(String pCatalog, String pSchema, String pTable) throws DataSourceException
getPK
in class DBAccess
pCatalog
- the catalog to usepSchema
- the schema to usepTable
- the table to use
DataSourceException
- if an error occur during PK search process.public List<ForeignKey> getFKs(String pCatalog, String pSchema, String pTable) throws DataSourceException
getFKs
in class DBAccess
pCatalog
- the catalog to usepSchema
- the schema to usepTable
- the table to use as base table.
DataSourceException
- if an error occur in determining the ForeignKeys.public List<Key> getUKs(String pCatalog, String pSchema, String pTable) throws DataSourceException
getUKs
in class DBAccess
pCatalog
- the catalog to usepSchema
- the schema to usepTable
- the table to use
DataSourceException
- if an error occur during UK search process.public Hashtable<String,Object> getDefaultValues(String pCatalog, String pSchema, String pTable) throws DataSourceException
getDefaultValues
in class DBAccess
pCatalog
- 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 DBAccess
pUsername
- 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 |