Package org.eclipse.net4j.db
Interface IDBAdapter
- 
- All Known Implementing Classes:
- DBAdapter,- DerbyAdapter,- EmbeddedDerbyAdapter,- H2Adapter,- HSQLDBAdapter,- MYSQLAdapter,- PostgreSQLAdapter
 
 public interface IDBAdapterAbstracts 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 SummaryFields Modifier and Type Field Description static org.eclipse.net4j.util.registry.IRegistry<java.lang.String,IDBAdapter>REGISTRY
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description DBTypeadaptType(DBType type)Provide a way for the DBAdapter to override unsupported DB types with replacements.IDBConnectionProvidercreateConnectionProvider(javax.sql.DataSource dataSource)javax.sql.DataSourcecreateJDBCDataSource()Deprecated.As of 4.2 no longer supported because of IP issues for external build dependencies (the vendor driver libs).booleancreateTable(IDBTable table, java.sql.Statement statement)java.util.Set<IDBTable>createTables(java.lang.Iterable<? extends IDBTable> tables, java.sql.Connection connection)booleandropTable(IDBTable table, java.sql.Statement statement)java.util.Collection<IDBTable>dropTables(java.lang.Iterable<? extends IDBTable> tables, java.sql.Connection connection)intgetFieldLength(DBType type)Returns the column length for the given database type.java.sql.DrivergetJDBCDriver()Deprecated.As of 4.2 no longer supported because of IP issues for external build dependencies (the vendor driver libs).intgetMaxFieldNameLength()intgetMaxTableNameLength()java.lang.StringgetName()java.lang.String[]getReservedWords()java.lang.StringgetVersion()booleanisColumnNotFoundException(java.sql.SQLException ex)booleanisDuplicateKeyException(java.sql.SQLException ex)Check if an exception indicates a constraint violation (duplicate key)booleanisReservedWord(java.lang.String word)booleanisTableNotFoundException(java.sql.SQLException ex)booleanisTypeIndexable(DBType type)booleanisValidFirstChar(char ch)Check if a character is valid as first character.java.sql.ConnectionmodifyConnection(java.sql.Connection connection)IDBSchemareadSchema(java.sql.Connection connection, java.lang.String name)voidreadSchema(java.sql.Connection connection, IDBSchema schema)java.lang.StringsqlModifyField(IDBField field)java.lang.StringsqlRenameField(IDBField field, java.lang.String oldName)voidupdateSchema(java.sql.Connection connection, IDBSchema schema, IDBSchemaDelta delta)
 
- 
- 
- 
Field Detail- 
REGISTRYstatic final org.eclipse.net4j.util.registry.IRegistry<java.lang.String,IDBAdapter> REGISTRY 
 
- 
 - 
Method Detail- 
getNamejava.lang.String getName() 
 - 
getVersionjava.lang.String getVersion() 
 - 
getJDBCDriver@Deprecated java.sql.Driver getJDBCDriver() Deprecated.As of 4.2 no longer supported because of IP issues for external build dependencies (the vendor driver libs).
 - 
createJDBCDataSource@Deprecated javax.sql.DataSource createJDBCDataSource() Deprecated.As of 4.2 no longer supported because of IP issues for external build dependencies (the vendor driver libs).
 - 
createConnectionProviderIDBConnectionProvider createConnectionProvider(javax.sql.DataSource dataSource) - Since:
- 4.3
 
 - 
modifyConnectionjava.sql.Connection modifyConnection(java.sql.Connection connection) - Since:
- 4.5
 
 - 
readSchemaIDBSchema readSchema(java.sql.Connection connection, java.lang.String name) - Since:
- 4.2
 
 - 
readSchemavoid readSchema(java.sql.Connection connection, IDBSchema schema)- Since:
- 4.2
 
 - 
updateSchemavoid updateSchema(java.sql.Connection connection, IDBSchema schema, IDBSchemaDelta delta) throws DBException- Throws:
- DBException
- Since:
- 4.2
 
 - 
createTablesjava.util.Set<IDBTable> createTables(java.lang.Iterable<? extends IDBTable> tables, java.sql.Connection connection) throws DBException - Throws:
- DBException
 
 - 
createTableboolean createTable(IDBTable table, java.sql.Statement statement) throws DBException - Throws:
- DBException
 
 - 
dropTablesjava.util.Collection<IDBTable> dropTables(java.lang.Iterable<? extends IDBTable> tables, java.sql.Connection connection) throws DBException - Throws:
- DBException
 
 - 
dropTableboolean dropTable(IDBTable table, java.sql.Statement statement) 
 - 
getReservedWordsjava.lang.String[] getReservedWords() 
 - 
isReservedWordboolean isReservedWord(java.lang.String word) 
 - 
getMaxTableNameLengthint getMaxTableNameLength() - Since:
- 2.0
 
 - 
getMaxFieldNameLengthint getMaxFieldNameLength() - Since:
- 2.0
 
 - 
getFieldLengthint getFieldLength(DBType type) Returns the column length for the given database type.- Parameters:
- type- the- DBTypeto check.
- Returns:
- the supported column length for the type.
- Since:
- 4.2
 
 - 
isTypeIndexableboolean isTypeIndexable(DBType type) 
 - 
adaptTypeDBType adaptType(DBType type) 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
 
 - 
isValidFirstCharboolean 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
 
 - 
isDuplicateKeyExceptionboolean isDuplicateKeyException(java.sql.SQLException ex) Check if an exception indicates a constraint violation (duplicate key)- Since:
- 4.0
 
 - 
isTableNotFoundExceptionboolean isTableNotFoundException(java.sql.SQLException ex) - Since:
- 4.2
 
 - 
isColumnNotFoundExceptionboolean isColumnNotFoundException(java.sql.SQLException ex) - Since:
- 4.2
 
 - 
sqlRenameFieldjava.lang.String sqlRenameField(IDBField field, java.lang.String oldName) - Since:
- 4.2
 
 - 
sqlModifyFieldjava.lang.String sqlModifyField(IDBField field) - Since:
- 4.2
 
 
- 
 
-