|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Dbms
A Database Management System.
| Method Summary | |
|---|---|
java.lang.String |
alterColumnNotNullableSQL(java.lang.String tableName,
Column column)
Return the SQL snippet to alter a column to not nullable. |
java.lang.String |
booleanTrueExpression(Column booleanColumn)
Accomodate lack of boolean types. |
boolean |
canBeIndexed(Column column)
Whether a Column can have an SQL index applied to it. |
boolean |
canDropColumns()
Whether this DBMS can drop columns. |
PoemType |
canRepresent(PoemType storage,
PoemType type)
Enable one PoemType to represent another, for example a bit to represent a boolean. |
boolean |
canStoreBlobs()
Whether this DBMS can store binary data. |
java.lang.String |
caseInsensitiveRegExpSQL(java.lang.String term1,
java.lang.String term2)
Accomodate the variety of ways of ignoring case. |
java.lang.String |
createTableOptionsSql()
Accomodate MySQL table creation options. |
java.lang.String |
createTableSql(Table table)
|
java.lang.String |
createTableTypeQualifierSql(Table table)
Allow Hsqldb to have a different create table syntax. |
SQLPoemType |
defaultPoemTypeOfColumnMetaData(java.sql.ResultSet rs)
The simplest POEM type corresponding to a JDBC description from the database. |
SQLPoemException |
exceptionForUpdate(Table table,
java.sql.PreparedStatement ps,
boolean insert,
java.sql.SQLException e)
Version of previous method for PreparedStatements. |
SQLPoemException |
exceptionForUpdate(Table table,
java.lang.String sql,
boolean insert,
java.sql.SQLException e)
An exception appropriate for expressing what really went wrong during a write to the db. |
java.lang.String |
getBinarySqlDefinition(int size)
Accomodate different treatment of different sized binary data. |
java.sql.Connection |
getConnection(java.lang.String url,
java.lang.String user,
java.lang.String password)
Return a connection. |
java.lang.String |
getFixedPtSqlDefinition(int scale,
int precision)
Accomodate differing Fixed Point notations. |
java.lang.String |
getForeignKeyDefinition(java.lang.String tableName,
java.lang.String fieldName,
java.lang.String targetTableName,
java.lang.String targetTableFieldName,
java.lang.String fixName)
If Foreign key definitions are part of field definitions, otherwise blank (silently unsupported). |
java.lang.String |
getIndexLength(Column column)
Accomodate DBMS which require a length for BLOBS. |
java.lang.String |
getJdbcMetadataName(java.lang.String name)
Some DBMSen (HSQLDB) use canonical uppercased names in the metadata but not in normal use. |
java.lang.String |
getLongSqlDefinition()
Accomodate Long / Bigint deviants. |
java.lang.String |
getPrimaryKeyDefinition(java.lang.String fieldName)
Return the PRIMARY KEY definition string for this dbms. |
java.lang.String |
getQuotedName(java.lang.String name)
Accomodate different quoting strategies. |
java.lang.String |
getQuotedValue(SQLType sqlType,
java.lang.String value)
Accomodate different quoting strategies for values. |
java.lang.String |
getSchema()
The db schema name to use, if any. |
java.lang.String |
getSqlDefaultValue(SQLType type)
Used to set a not null value when creating a non nullable column. |
java.lang.String |
getSqlDefinition(java.lang.String sqlTypeName)
Retrieve a SQL type keyword used by the DBMS for the given Melati type name. |
java.lang.String |
getStringSqlDefinition(int size)
Accomodate String / Text distinction. |
java.lang.String |
givesCapabilitySQL(java.lang.Integer userTroid,
java.lang.String capabilityExpr)
SQL string to get a Capability. |
java.lang.String |
melatiName(java.lang.String name)
Reverse the mapping in unreservedName. |
java.lang.String |
preparedStatementPlaceholder(PoemType type)
Accomodate casting in placeholders. |
java.lang.String |
selectLimit(java.lang.String querySelection,
int limit)
Accomodate different limiting syntax. |
void |
shutdown(java.sql.Connection connection)
A no-op for all but hsqldb, where the db needs to be shutdown when the servlet container or jvm is destroyed. |
java.lang.String |
sqlBooleanValueOfRaw(java.lang.Object raw)
Accomodate different true and false values. |
java.lang.String |
tableInitialisationSql(Table table)
|
java.lang.String |
toString()
A string to represent this DBMS. |
void |
unloadDriver()
Used in tests to allow multiple dbmsen to be loaded and unloaded. |
java.lang.String |
unreservedName(java.lang.String name)
Translate special names to non special ones. |
| Method Detail |
|---|
void unloadDriver()
java.sql.Connection getConnection(java.lang.String url,
java.lang.String user,
java.lang.String password)
throws ConnectionFailurePoemException
url - the jdbc URLuser - the user to connect as, may be nullpassword - the password for user, may be null
ConnectionFailurePoemException - is we cannot connectjava.lang.String getSchema()
void shutdown(java.sql.Connection connection)
throws java.sql.SQLException
java.sql.SQLExceptionjava.lang.String getQuotedName(java.lang.String name)
name - the unquoted name
java.lang.String getQuotedValue(SQLType sqlType,
java.lang.String value)
sqlType - the SQLType of the valuevalue - the value
java.lang.String getJdbcMetadataName(java.lang.String name)
name - entity name such as tableinfo
java.lang.String preparedStatementPlaceholder(PoemType type)
type -
Postgresqljava.lang.String createTableSql(Table table)
java.lang.String createTableTypeQualifierSql(Table table)
java.lang.String createTableOptionsSql()
java.lang.String tableInitialisationSql(Table table)
table -
java.lang.String getSqlDefinition(java.lang.String sqlTypeName)
sqlTypeName - the Melati internal type name
java.lang.String getStringSqlDefinition(int size)
throws java.sql.SQLException
size - the string length (-1 means no limit)
java.sql.SQLExceptionjava.lang.String getLongSqlDefinition()
java.lang.String sqlBooleanValueOfRaw(java.lang.Object raw)
java.lang.String getBinarySqlDefinition(int size)
throws java.sql.SQLException
size - how big the field is
java.sql.SQLException
java.lang.String getFixedPtSqlDefinition(int scale,
int precision)
throws java.sql.SQLException
scale - the number of places to right of decimal pointprecision - how many digits in total
java.sql.SQLException - potentially
PoemType canRepresent(PoemType storage,
PoemType type)
storage - the POEM native typetype - the current type
SQLPoemType defaultPoemTypeOfColumnMetaData(java.sql.ResultSet rs)
throws java.sql.SQLException
rs - the JDBC metadata
java.sql.SQLException - potentiallyboolean canDropColumns()
boolean canStoreBlobs()
SQLPoemException exceptionForUpdate(Table table,
java.lang.String sql,
boolean insert,
java.sql.SQLException e)
table - The table on which the update was affectedsql - The operation attempted, or possibly nullinsert - Whether the operation was an INSERT as
opposed to an UPDATEe - The raw SQL exception: the routine is meant to
try to interpret e.getMessage if it can
Postgresql.exceptionForUpdate(org.melati.poem.Table, java.lang.String, boolean, java.sql.SQLException)
SQLPoemException exceptionForUpdate(Table table,
java.sql.PreparedStatement ps,
boolean insert,
java.sql.SQLException e)
table - The table on which the update was affectedps - The operation attempted, or possibly nullinsert - Whether the operation was an INSERT as
opposed to an UPDATEe - The raw SQL exception: the routine is meant to
try to interpret e.getMessage if it can
AnsiStandard.exceptionForUpdate(org.melati.poem.Table, java.lang.String,
boolean, java.sql.SQLException)java.lang.String unreservedName(java.lang.String name)
name - the field or table name
java.lang.String melatiName(java.lang.String name)
name - an SQL name
java.lang.String getIndexLength(Column column)
column - the POEM Column we are dealing with
boolean canBeIndexed(Column column)
column - the POEM Column we are dealing with
java.lang.String givesCapabilitySQL(java.lang.Integer userTroid,
java.lang.String capabilityExpr)
userTroid - the troid of the User to use in the querycapabilityExpr - the capability troid we need
java.lang.String caseInsensitiveRegExpSQL(java.lang.String term1,
java.lang.String term2)
term1 - the term to find interm2 - the quoted term to find
java.lang.String toString()
toString in class java.lang.Object
java.lang.String getForeignKeyDefinition(java.lang.String tableName,
java.lang.String fieldName,
java.lang.String targetTableName,
java.lang.String targetTableFieldName,
java.lang.String fixName)
tableName - the table that this column is in, unquotedfieldName - often the name of the foreign table, unquotedtargetTableName - the table that this is a foreign key into, unquotedtargetTableFieldName - name of the primary key field of the foreign
table, often id, unquotedfixName - name of the IntegrityFix
java.lang.String getPrimaryKeyDefinition(java.lang.String fieldName)
fieldName - the table Troid column, often id, unquoted
java.lang.String alterColumnNotNullableSQL(java.lang.String tableName,
Column column)
tableName - column -
java.lang.String selectLimit(java.lang.String querySelection,
int limit)
querySelection - main body of querylimit - number to limit to
java.lang.String booleanTrueExpression(Column booleanColumn)
booleanColumn -
java.lang.String getSqlDefaultValue(SQLType type)
type - the type name
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||