|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mortbay.JDBC.DbAdaptor
An adaptor class for JDBC drivers
this class provides helper functions to handle the differences in JDBC drivers.
Specifically it provides help with data types, quoting strings and allow table creation from java described meta data (the opposite of the intended JDBC style where the driver provides an often unimplemented API to access the metadata).
The default implementation is for a standard ANSI SQL database whose JDBC driver is specified by the java property "DbDriver" This class must be specialized to handle any specific behaviour of a particular DB/JDBCdriver combination and the derived class name should be passed to the constructor of Database
Database
Field Summary | |
protected java.lang.String |
dbDriver
|
Constructor Summary | |
DbAdaptor()
Constructor. |
Method Summary | |
java.lang.String |
columnType(int type)
Map the a column type to database column type. |
java.lang.String |
formatColumnValue(Column column,
java.lang.Object value)
Format a column value |
java.lang.String |
formatCreateIndex(Table table)
Format the index creation statements for a table |
java.lang.String |
formatCreateTable(Table table)
Format a table create statement. |
java.lang.String |
formatKeys(Table table)
Format the key columns for a table Return string describing the key columns for a CREATE statement. |
java.lang.String |
formatTable(Table table)
Format table columns |
java.lang.String |
getJdbcDriver()
Get the JDBC driver class name for this adaptor. |
java.lang.String |
go()
The go string |
java.lang.Object |
nullColumnValue(Column column)
A null value for the column |
java.lang.String |
primaryMarker()
The marker used when creating a table to mark a primary key. |
java.lang.String |
quote(java.lang.String s)
Quote a string value for the database. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.lang.String dbDriver
Constructor Detail |
public DbAdaptor()
Method Detail |
public java.lang.String getJdbcDriver()
public java.lang.String quote(java.lang.String s)
s
- A stringpublic java.lang.String columnType(int type)
type
- The column type (see Column)public java.lang.String formatColumnValue(Column column, java.lang.Object value)
column
- The column to format the value forvalue
- The value of the columnpublic java.lang.Object nullColumnValue(Column column)
column
- The Columnpublic java.lang.String primaryMarker()
public java.lang.String go()
public java.lang.String formatKeys(Table table)
table
- The tablepublic java.lang.String formatTable(Table table)
table
- The tablepublic java.lang.String formatCreateTable(Table table)
table
- The tablepublic java.lang.String formatCreateIndex(Table table)
table
- The Table
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |