Package org.eclipse.net4j.db
Interface IDBAdapter
- All Known Implementing Classes:
DBAdapter,DerbyAdapter,EmbeddedDerbyAdapter,H2Adapter,HSQLDBAdapter,MYSQLAdapter,PostgreSQLAdapter
public interface IDBAdapter
Abstracts all aspects of a database that are vendor-specific.
- Author:
- Eike Stepper
- No Implement
- This interface is not intended to be implemented by clients. Subclass
DBAdapterinstead.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.eclipse.net4j.util.registry.IRegistry<String,IDBAdapter> -
Method Summary
Modifier and TypeMethodDescriptionProvide a way for the DBAdapter to override unsupported DB types with replacements.createConnectionProvider(DataSource dataSource) Deprecated.As of 4.2 no longer supported because of IP issues for external build dependencies (the vendor driver libs).voidcreateSchema(Connection connection, String schemaName) booleancreateTable(IDBTable table, Statement statement) createTables(Iterable<? extends IDBTable> tables, Connection connection) booleandropTables(Iterable<? extends IDBTable> tables, Connection connection) getDefaultSchemaName(Connection connection) intgetFieldLength(DBType type) Returns the column length for the given database type.Deprecated.As of 4.2 no longer supported because of IP issues for external build dependencies (the vendor driver libs).intintgetName()String[]booleanbooleanbooleanCheck if an exception indicates a constraint violation (duplicate key)booleanisReservedWord(String word) booleanbooleanisTypeIndexable(DBType type) booleanisValidFirstChar(char ch) Check if a character is valid as first character.modifyConnection(Connection connection) readSchema(Connection connection, String name) voidreadSchema(Connection connection, IDBSchema schema) sqlModifyField(IDBField field) sqlRenameField(IDBField field, String oldName) voidupdateSchema(Connection connection, IDBSchema schema, IDBSchemaDelta delta)
-
Field Details
-
REGISTRY
-
-
Method Details
-
getName
String getName() -
getVersion
String getVersion() -
isCaseSensitive
boolean isCaseSensitive()- Since:
- 4.12
-
getDefaultSchemaName
- Since:
- 4.12
-
createConnectionProvider
- Since:
- 4.3
-
modifyConnection
- Since:
- 4.5
-
createSchema
- Since:
- 4.12
-
readSchema
- Since:
- 4.2
-
readSchema
- Since:
- 4.2
-
updateSchema
- Throws:
DBException- Since:
- 4.2
-
createTables
Set<IDBTable> createTables(Iterable<? extends IDBTable> tables, Connection connection) throws DBException - Throws:
DBException
-
createTable
- Throws:
DBException
-
dropTables
Collection<IDBTable> dropTables(Iterable<? extends IDBTable> tables, Connection connection) throws DBException - Throws:
DBException
-
dropTable
-
getReservedWords
String[] getReservedWords() -
isReservedWord
-
getMaxTableNameLength
int getMaxTableNameLength()- Since:
- 2.0
-
getMaxFieldNameLength
int getMaxFieldNameLength()- Since:
- 2.0
-
getFieldLength
Returns the column length for the given database type.- Parameters:
type- theDBTypeto check.- Returns:
- the supported column length for the type.
- Since:
- 4.2
-
isTypeIndexable
-
adaptType
Provide 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.- Since:
- 3.0
-
isValidFirstChar
boolean isValidFirstChar(char ch) Check if a character is valid as first character. (e.g., underscores are forbidden as first character in Derby elements.- Since:
- 4.0
-
isDuplicateKeyException
Check if an exception indicates a constraint violation (duplicate key)- Since:
- 4.0
-
isTableNotFoundException
- Since:
- 4.2
-
isColumnNotFoundException
- Since:
- 4.2
-
sqlRenameField
- Since:
- 4.2
-
sqlModifyField
- Since:
- 4.2
-
getJDBCDriver
Deprecated.As of 4.2 no longer supported because of IP issues for external build dependencies (the vendor driver libs). -
createJDBCDataSource
Deprecated.As of 4.2 no longer supported because of IP issues for external build dependencies (the vendor driver libs).
-