Package org.eclipse.net4j.spi.db
Klasse DBAdapter
java.lang.Object
org.eclipse.net4j.spi.db.DBAdapter
- Alle implementierten Schnittstellen:
IDBAdapter
- Bekannte direkte Unterklassen:
DerbyAdapter,H2Adapter,HSQLDBAdapter,MYSQLAdapter,PostgreSQLAdapter
A useful base class for implementing custom
DB adapters.- Autor:
- Eike Stepper
-
Verschachtelte Klassen - Übersicht
Verschachtelte Klassen -
Feldübersicht
Von Schnittstelle geerbte Felder org.eclipse.net4j.db.IDBAdapter
REGISTRY -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungProvide a way for the DBAdapter to override unsupported DB types with replacements.protected voidaddIndex(Connection connection, IDBTable table, String name, IDBIndex.Type type, List<DBAdapter.FieldInfo> fieldInfos) protected voidaddIndexField(StringBuilder builder, IDBField field) protected voidalterTable(Connection connection, IDBTable table, IDBTableDelta delta) protected voidappendFieldDefs(Appendable appendable, IDBTable table, String[] defs) voidappendFieldNames(Appendable appendable, IDBTable table) convertString(PreparedStatement preparedStatement, int parameterIndex, String value) convertString(ResultSet resultSet, int columnIndex, String value) convertString(ResultSet resultSet, String columnLabel, String value) convertToSQL(Object value) createConnectionProvider(DataSource dataSource) protected StringcreateConstraints(IDBTable table) protected voidcreateField(Connection connection, String tableName, IDBField field) protected StringcreateFieldDefinition(IDBField field) protected String[]createFieldDefinitions(IDBTable table) protected voidcreateIndex(Connection connection, IDBIndex index, IDBIndexDelta delta) protected voidcreateIndex(IDBIndex index, StringBuilder builder) protected voidcreateIndex(IDBIndex index, Statement statement, int num) protected voidcreateIndexFields(IDBIndex index, StringBuilder builder) Veraltet.As of 4.2 no longer supported because of IP issues for external build dependencies (the vendor driver libs).protected voidcreatePrimaryKey(IDBIndex index, StringBuilder builder) voidcreateSchema(Connection connection, String schemaName) protected voidcreateTable(Connection connection, IDBTable table, IDBTableDelta delta) booleancreateTable(IDBTable table, Statement statement) createTables(Iterable<? extends IDBTable> tables, Connection connection) protected voiddoCreateTable(IDBTable table, Statement statement) protected voiddropField(Connection connection, String tableName, String fieldName) protected voiddropIndex(Connection connection, IDBIndex index, IDBIndexDelta delta) protected voiddropIndex(IDBIndex index, StringBuilder builder) protected voiddropPrimaryKey(IDBIndex index, StringBuilder builder) protected voiddropTable(Connection connection, IDBTable table, IDBTableDelta delta) booleandropTables(Iterable<? extends IDBTable> tables, Connection connection) format(PreparedStatement stmt) protected static voidgenerateReservedWords(Connection connection, String[] words) static intgetDefaultDBLength(DBType type) getDefaultSchemaName(Connection connection) protected StringgetDropTableSQL(IDBTable table) intgetFieldLength(DBType type) Returns the column length for the given database type.Veraltet.As of 4.2 no longer supported because of IP issues for external build dependencies (the vendor driver libs).intintgetName()protected StringString[]protected StringgetTypeName(IDBField field) booleanbooleanbooleanCheck if an exception indicates a constraint violation (duplicate key)protected booleanisPrimaryKeyShadow(Connection connection, IDBTable table, String name, IDBIndex.Type type, IDBField[] fields) booleanisReservedWord(String word) booleanbooleanisTypeIndexable(DBType type) booleanisValidFirstChar(char ch) Check if a character is valid as first character.modifyConnection(Connection connection) openSchemaTransaction(IDBDatabase database, IDBConnection currentConnection) protected voidreadFields(Connection connection, IDBTable table) protected voidreadIndices(Connection connection, DatabaseMetaData metaData, IDBTable table, String schemaName) protected voidreadIndices(Connection connection, ResultSet resultSet, IDBTable table, int indexNameColumn, int indexTypeColumn, int fieldNameColumn, int fieldPositionColumn) readSchema(Connection connection, String name) voidreadSchema(Connection connection, IDBSchema schema) protected ResultSetreadTables(Connection connection, DatabaseMetaData metaData, String schemaName) protected StringsqlModifyField(String tableName, String fieldName, String definition) sqlModifyField(IDBField field) sqlRenameField(IDBField field, String oldName) toString()voidupdateSchema(Connection connection, IDBSchema schema, IDBSchemaDelta delta) protected voidvalidateTable(IDBTable table, Statement statement) Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden org.eclipse.net4j.db.IDBAdapter
getReservedWords
-
Konstruktordetails
-
DBAdapter
-
-
Methodendetails
-
getName
- Angegeben von:
getNamein SchnittstelleIDBAdapter
-
getVersion
- Angegeben von:
getVersionin SchnittstelleIDBAdapter
-
isCaseSensitive
public boolean isCaseSensitive()- Angegeben von:
isCaseSensitivein SchnittstelleIDBAdapter
-
getDefaultSchemaName
- Angegeben von:
getDefaultSchemaNamein SchnittstelleIDBAdapter
-
createConnectionProvider
- Angegeben von:
createConnectionProviderin SchnittstelleIDBAdapter- Seit:
- 4.3
-
modifyConnection
- Angegeben von:
modifyConnectionin SchnittstelleIDBAdapter- Seit:
- 4.5
-
createSchema
- Angegeben von:
createSchemain SchnittstelleIDBAdapter
-
openSchemaTransaction
public IDBSchemaTransaction openSchemaTransaction(IDBDatabase database, IDBConnection currentConnection) - Seit:
- 4.9
-
readSchema
- Angegeben von:
readSchemain SchnittstelleIDBAdapter- Seit:
- 4.2
-
readSchema
- Angegeben von:
readSchemain SchnittstelleIDBAdapter- Seit:
- 4.2
-
readTables
protected ResultSet readTables(Connection connection, DatabaseMetaData metaData, String schemaName) throws SQLException - Löst aus:
SQLException- Seit:
- 4.3
-
readFields
- Löst aus:
SQLException- Seit:
- 4.2
-
readIndices
protected void readIndices(Connection connection, DatabaseMetaData metaData, IDBTable table, String schemaName) throws SQLException - Löst aus:
SQLException- Seit:
- 4.2
-
readIndices
protected void readIndices(Connection connection, ResultSet resultSet, IDBTable table, int indexNameColumn, int indexTypeColumn, int fieldNameColumn, int fieldPositionColumn) throws SQLException - Löst aus:
SQLException- Seit:
- 4.2
-
addIndex
protected void addIndex(Connection connection, IDBTable table, String name, IDBIndex.Type type, List<DBAdapter.FieldInfo> fieldInfos) - Seit:
- 4.2
-
isPrimaryKeyShadow
protected boolean isPrimaryKeyShadow(Connection connection, IDBTable table, String name, IDBIndex.Type type, IDBField[] fields) - Seit:
- 4.2
-
updateSchema
public void updateSchema(Connection connection, IDBSchema schema, IDBSchemaDelta delta) throws DBException - Angegeben von:
updateSchemain SchnittstelleIDBAdapter- Löst aus:
DBException- Seit:
- 4.2
-
createTable
- Seit:
- 4.2
-
dropTable
- Seit:
- 4.2
-
alterTable
- Seit:
- 4.2
-
createField
- Seit:
- 4.6
-
dropField
- Seit:
- 4.6
-
createIndex
- Seit:
- 4.2
-
createPrimaryKey
- Seit:
- 4.2
-
createIndex
- Seit:
- 4.2
-
createIndexFields
- Seit:
- 4.2
-
dropIndex
- Seit:
- 4.2
-
dropPrimaryKey
- Seit:
- 4.2
-
dropIndex
- Seit:
- 4.2
-
createTables
public Set<IDBTable> createTables(Iterable<? extends IDBTable> tables, Connection connection) throws DBException - Angegeben von:
createTablesin SchnittstelleIDBAdapter- Löst aus:
DBException
-
createTable
- Angegeben von:
createTablein SchnittstelleIDBAdapter- Löst aus:
DBException
-
dropTables
public Collection<IDBTable> dropTables(Iterable<? extends IDBTable> tables, Connection connection) throws DBException - Angegeben von:
dropTablesin SchnittstelleIDBAdapter- Löst aus:
DBException
-
dropTable
- Angegeben von:
dropTablein SchnittstelleIDBAdapter
-
getDropTableSQL
-
getMaxTableNameLength
public int getMaxTableNameLength()- Angegeben von:
getMaxTableNameLengthin SchnittstelleIDBAdapter- Seit:
- 2.0
-
getMaxFieldNameLength
public int getMaxFieldNameLength()- Angegeben von:
getMaxFieldNameLengthin SchnittstelleIDBAdapter- Seit:
- 2.0
-
getFieldLength
Beschreibung aus Schnittstelle kopiert:IDBAdapterReturns the column length for the given database type.- Angegeben von:
getFieldLengthin SchnittstelleIDBAdapter- Parameter:
type- theDBTypeto check.- Gibt zurück:
- the supported column length for the type.
- Seit:
- 4.2
-
isTypeIndexable
- Angegeben von:
isTypeIndexablein SchnittstelleIDBAdapter
-
toString
-
convertString
- Seit:
- 4.3
-
convertString
- Seit:
- 4.3
-
convertString
- Seit:
- 4.3
-
doCreateTable
- Löst aus:
SQLException- Seit:
- 2.0
-
createIndex
- Löst aus:
SQLException- Seit:
- 2.0
-
addIndexField
-
createConstraints
- Seit:
- 2.0
-
createFieldDefinition
- Seit:
- 2.0
-
getNullableConstraint
- Seit:
- 4.12
-
getTypeName
-
getSQL92ReservedWords
-
isReservedWord
- Angegeben von:
isReservedWordin SchnittstelleIDBAdapter
-
validateTable
- Löst aus:
DBException- Seit:
- 2.0
-
createFieldDefinitions
- Seit:
- 4.2
-
appendFieldNames
-
appendFieldDefs
- Seit:
- 4.2
-
adaptType
Beschreibung aus Schnittstelle kopiert:IDBAdapterProvide a way for the DBAdapter to override unsupported DB types with replacements. The default implementation just returns the given type. Subclasses may override single types with replacements.- Angegeben von:
adaptTypein SchnittstelleIDBAdapter- Seit:
- 3.0
-
isValidFirstChar
public boolean isValidFirstChar(char ch) Beschreibung aus Schnittstelle kopiert:IDBAdapterCheck if a character is valid as first character. (e.g., underscores are forbidden as first character in Derby elements.- Angegeben von:
isValidFirstCharin SchnittstelleIDBAdapter- Seit:
- 4.0
-
isDuplicateKeyException
Beschreibung aus Schnittstelle kopiert:IDBAdapterCheck if an exception indicates a constraint violation (duplicate key)- Angegeben von:
isDuplicateKeyExceptionin SchnittstelleIDBAdapter- Seit:
- 4.0
-
isTableNotFoundException
- Angegeben von:
isTableNotFoundExceptionin SchnittstelleIDBAdapter- Seit:
- 4.2
-
isColumnNotFoundException
- Angegeben von:
isColumnNotFoundExceptionin SchnittstelleIDBAdapter- Seit:
- 4.2
-
sqlRenameField
- Angegeben von:
sqlRenameFieldin SchnittstelleIDBAdapter- Seit:
- 4.2
-
sqlModifyField
- Angegeben von:
sqlModifyFieldin SchnittstelleIDBAdapter- Seit:
- 4.2
-
sqlModifyField
- Seit:
- 4.2
-
format
- Seit:
- 4.2
-
format
- Seit:
- 4.2
-
convertToSQL
- Seit:
- 4.9
-
getDefaultDBLength
- Seit:
- 4.2
-
generateReservedWords
protected static void generateReservedWords(Connection connection, String[] words) throws SQLException - Löst aus:
SQLException- Seit:
- 4.9
-
getJDBCDriver
Veraltet.As of 4.2 no longer supported because of IP issues for external build dependencies (the vendor driver libs).- Angegeben von:
getJDBCDriverin SchnittstelleIDBAdapter- Seit:
- 4.2
-
createJDBCDataSource
Veraltet.As of 4.2 no longer supported because of IP issues for external build dependencies (the vendor driver libs).- Angegeben von:
createJDBCDataSourcein SchnittstelleIDBAdapter- Seit:
- 4.2
-