|
SolarMetric Kodo JDO 2.4.3 generated on March 27 2003 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Interface which allows the creation of SQL dynamically, in a database agnostic fashion.
| Method Summary | |
|---|---|
boolean |
booleanFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
booleanToSQL(boolean val)
Convert data into SQL for the current database platform. |
byte |
byteFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
byteToSQL(byte val)
Convert data into SQL for the current database platform. |
char |
charFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
charToSQL(char val)
Convert data into SQL for the current database platform. |
double |
doubleFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
doubleToSQL(double val)
Convert data into SQL for the current database platform. |
float |
floatFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
floatToSQL(float val)
Convert data into SQL for the current database platform. |
Object |
fromSQL(int type,
ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
SQLBuffer[] |
getAddColumnSQL(Column column)
Return a series of SQL statements to add the given column to its table, including the addition of any indexes on the column. |
ResultSet |
getColumns(String tableName,
Connection conn)
Return a ResultSet with all the column names in the given table. |
SQLBuffer[] |
getCreateTableSQL(Table table)
Return a series of SQL statements to create the given table, including any indexes it has. |
DBMetaData |
getDBMetaData()
Get the DBMetaData for this dictionary. |
SQLBuffer[] |
getDropColumnSQL(Column column)
Return a series of SQL statements to drop the given column from its table, including the deletion of any indices from the column. |
SQLBuffer[] |
getDropTableSQL(Table table)
Return a series of SQL statements to drop the given table, including any indexes it may have. |
Class[] |
getFieldMappingCandidateClasses()
Returns a list of possible FieldMapping classes for
use with this DBDictionary. |
String |
getPlatform()
Return the name of the platform for the DB type handled; for example, Oracle |
ResultSet |
getTables(Connection conn)
Return a ResultSet with all the tables in the database. |
String |
getValidColumnName(String name)
Make any necessary changes to the given column name to make it valid for the current DB. |
String |
getValidIndexName(String name)
Make any necessary changes to the given index name to make it valid for the current DB. |
String |
getValidTableName(String name)
Make any necessary changes to the given table name to make it valid for the current DB. |
int |
intFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
intToSQL(int val)
Convert data into SQL for the current database platform. |
boolean |
isClosed(Connection conn)
Some JDBC drivers do not validate the state of the Connection when Connection.isClosed()
is invoked. |
long |
longFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
longToSQL(long val)
Convert data into SQL for the current database platform. |
void |
setColumnNameGenerator(NameGenerator generator)
Set the NameGenerator to use for generating column names. |
void |
setCursorName(Statement stmnt,
SQLBuffer buffer)
Sets the cursor name a statment. |
void |
setDBMetaData(DBMetaData meta)
Set the DBMetaData for this dictionary. |
void |
setIndexNameGenerator(NameGenerator generator)
Set the NameGenerator to use for generating index names. |
void |
setTransactionIsolation(Connection conn,
JDBCConfiguration config)
Setup the transaction isolation level on the Connection. |
short |
shortFromSQL(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
shortToSQL(short val)
Convert data into SQL for the current database platform. |
boolean |
supportsLocking()
Returns whether or not this database supports locking (e.g., FOR UPDATE clause in SELECT). |
boolean |
supportsUpdateCountsForBatch()
Returns true if the JDBC driver supports correct update counts in the return value from Statement.executeBatch(). |
void |
toPreparedParameter(int type,
PreparedStatement st,
int i,
Object val)
Set val as the i'th (base 1) element
in st. |
SQLBuffer |
toSelect(String[] cols,
String[] tables,
SQLBuffer where,
SQLBuffer order,
boolean distinct,
boolean update)
Create a SELECT statement for this databse from the given parts. |
Object |
toSQL(int type,
Object obj)
Convert data into SQL for the current database platform. |
| Method Detail |
public DBMetaData getDBMetaData()
public void setDBMetaData(DBMetaData meta)
public boolean isClosed(Connection conn)
Connection when Connection.isClosed()
is invoked. This method will issue a small SQL
statement to validate that the Connection
is actually in a usable state.Connection is not validpublic String getPlatform()
public Object toSQL(int type,
Object obj)
SQLTypes.public Object booleanToSQL(boolean val)
public Object byteToSQL(byte val)
public Object charToSQL(char val)
public Object doubleToSQL(double val)
public Object floatToSQL(float val)
public Object intToSQL(int val)
public Object longToSQL(long val)
public Object shortToSQL(short val)
public Object fromSQL(int type,
ResultSet rs,
int column)
throws SQLException
SQLTypes.
public boolean booleanFromSQL(ResultSet rs,
int column)
throws SQLException
public byte byteFromSQL(ResultSet rs,
int column)
throws SQLException
public char charFromSQL(ResultSet rs,
int column)
throws SQLException
public double doubleFromSQL(ResultSet rs,
int column)
throws SQLException
public float floatFromSQL(ResultSet rs,
int column)
throws SQLException
public int intFromSQL(ResultSet rs,
int column)
throws SQLException
public long longFromSQL(ResultSet rs,
int column)
throws SQLException
public short shortFromSQL(ResultSet rs,
int column)
throws SQLException
public void toPreparedParameter(int type,
PreparedStatement st,
int i,
Object val)
throws SQLException
val as the i'th (base 1) element
in st. The given type will be from SQLTypes.
public SQLBuffer toSelect(String[] cols,
String[] tables,
SQLBuffer where,
SQLBuffer order,
boolean distinct,
boolean update)
cols - list of values the columns to selecttables - list of the tables to select fromwhere - the WHERE conditions; may be null if noneorder - the ORDER BY conditions; may be null if nonedistinct - if true, this should be a SELECT DISTINCT-equivalent
queryupdate - if true this should be a SELECT FOR
UPDATE-equivalent querypublic String getValidTableName(String name)
public String getValidColumnName(String name)
public String getValidIndexName(String name)
public SQLBuffer[] getCreateTableSQL(Table table)
public SQLBuffer[] getDropTableSQL(Table table)
public SQLBuffer[] getAddColumnSQL(Column column)
public SQLBuffer[] getDropColumnSQL(Column column)
public ResultSet getTables(Connection conn)
throws SQLException
public ResultSet getColumns(String tableName,
Connection conn)
throws SQLException
Connection.getColumns(String,String,String,String[])
invocation, but the actual dictionary can choose to
implement this however they like, provided that
the ResultSet that is returned contains the following
columns:
public Class[] getFieldMappingCandidateClasses()
FieldMapping classes for
use with this DBDictionary.public boolean supportsLocking()
public void setIndexNameGenerator(NameGenerator generator)
NameGenerator to use for generating index names.public void setColumnNameGenerator(NameGenerator generator)
NameGenerator to use for generating column names.public boolean supportsUpdateCountsForBatch()
Statement.executeBatch().
public void setTransactionIsolation(Connection conn,
JDBCConfiguration config)
throws SQLException
JDBCConfiguration.getTransactionIsolationLevel(), but the
dictionary implementation retains the option of overriding
the default transaction level.
public void setCursorName(Statement stmnt,
SQLBuffer buffer)
throws SQLException
|
SolarMetric Kodo JDO 2.4.3 generated on March 27 2003 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||