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 void
addIndex
(Connection connection, IDBTable table, String name, IDBIndex.Type type, List<DBAdapter.FieldInfo> fieldInfos) protected void
addIndexField
(StringBuilder builder, IDBField field) protected void
alterTable
(Connection connection, IDBTable table, IDBTableDelta delta) protected void
appendFieldDefs
(Appendable appendable, IDBTable table, String[] defs) void
appendFieldNames
(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 String
createConstraints
(IDBTable table) protected void
createField
(Connection connection, String tableName, IDBField field) protected String
createFieldDefinition
(IDBField field) protected String[]
createFieldDefinitions
(IDBTable table) protected void
createIndex
(Connection connection, IDBIndex index, IDBIndexDelta delta) protected void
createIndex
(IDBIndex index, StringBuilder builder) protected void
createIndex
(IDBIndex index, Statement statement, int num) protected void
createIndexFields
(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 void
createPrimaryKey
(IDBIndex index, StringBuilder builder) void
createSchema
(Connection connection, String schemaName) protected void
createTable
(Connection connection, IDBTable table, IDBTableDelta delta) boolean
createTable
(IDBTable table, Statement statement) createTables
(Iterable<? extends IDBTable> tables, Connection connection) protected void
doCreateTable
(IDBTable table, Statement statement) protected void
dropField
(Connection connection, String tableName, String fieldName) protected void
dropIndex
(Connection connection, IDBIndex index, IDBIndexDelta delta) protected void
dropIndex
(IDBIndex index, StringBuilder builder) protected void
dropPrimaryKey
(IDBIndex index, StringBuilder builder) protected void
dropTable
(Connection connection, IDBTable table, IDBTableDelta delta) boolean
dropTables
(Iterable<? extends IDBTable> tables, Connection connection) format
(PreparedStatement stmt) protected static void
generateReservedWords
(Connection connection, String[] words) static int
getDefaultDBLength
(DBType type) getDefaultSchemaName
(Connection connection) protected String
getDropTableSQL
(IDBTable table) int
getFieldLength
(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).int
int
getName()
protected String
String[]
protected String
getTypeName
(IDBField field) boolean
boolean
boolean
Check if an exception indicates a constraint violation (duplicate key)protected boolean
isPrimaryKeyShadow
(Connection connection, IDBTable table, String name, IDBIndex.Type type, IDBField[] fields) boolean
isReservedWord
(String word) boolean
boolean
isTypeIndexable
(DBType type) boolean
isValidFirstChar
(char ch) Check if a character is valid as first character.modifyConnection
(Connection connection) openSchemaTransaction
(IDBDatabase database, IDBConnection currentConnection) protected void
readFields
(Connection connection, IDBTable table) protected void
readIndices
(Connection connection, DatabaseMetaData metaData, IDBTable table, String schemaName) protected void
readIndices
(Connection connection, ResultSet resultSet, IDBTable table, int indexNameColumn, int indexTypeColumn, int fieldNameColumn, int fieldPositionColumn) readSchema
(Connection connection, String name) void
readSchema
(Connection connection, IDBSchema schema) protected ResultSet
readTables
(Connection connection, DatabaseMetaData metaData, String schemaName) protected String
sqlModifyField
(String tableName, String fieldName, String definition) sqlModifyField
(IDBField field) sqlRenameField
(IDBField field, String oldName) toString()
void
updateSchema
(Connection connection, IDBSchema schema, IDBSchemaDelta delta) protected void
validateTable
(IDBTable table, Statement statement) Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden org.eclipse.net4j.db.IDBAdapter
getReservedWords
-
Konstruktordetails
-
DBAdapter
-
-
Methodendetails
-
getName
- Angegeben von:
getName
in SchnittstelleIDBAdapter
-
getVersion
- Angegeben von:
getVersion
in SchnittstelleIDBAdapter
-
isCaseSensitive
public boolean isCaseSensitive()- Angegeben von:
isCaseSensitive
in SchnittstelleIDBAdapter
-
getDefaultSchemaName
- Angegeben von:
getDefaultSchemaName
in SchnittstelleIDBAdapter
-
createConnectionProvider
- Angegeben von:
createConnectionProvider
in SchnittstelleIDBAdapter
- Seit:
- 4.3
-
modifyConnection
- Angegeben von:
modifyConnection
in SchnittstelleIDBAdapter
- Seit:
- 4.5
-
createSchema
- Angegeben von:
createSchema
in SchnittstelleIDBAdapter
-
openSchemaTransaction
public IDBSchemaTransaction openSchemaTransaction(IDBDatabase database, IDBConnection currentConnection) - Seit:
- 4.9
-
readSchema
- Angegeben von:
readSchema
in SchnittstelleIDBAdapter
- Seit:
- 4.2
-
readSchema
- Angegeben von:
readSchema
in 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:
updateSchema
in 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:
createTables
in SchnittstelleIDBAdapter
- Löst aus:
DBException
-
createTable
- Angegeben von:
createTable
in SchnittstelleIDBAdapter
- Löst aus:
DBException
-
dropTables
public Collection<IDBTable> dropTables(Iterable<? extends IDBTable> tables, Connection connection) throws DBException - Angegeben von:
dropTables
in SchnittstelleIDBAdapter
- Löst aus:
DBException
-
dropTable
- Angegeben von:
dropTable
in SchnittstelleIDBAdapter
-
getDropTableSQL
-
getMaxTableNameLength
public int getMaxTableNameLength()- Angegeben von:
getMaxTableNameLength
in SchnittstelleIDBAdapter
- Seit:
- 2.0
-
getMaxFieldNameLength
public int getMaxFieldNameLength()- Angegeben von:
getMaxFieldNameLength
in SchnittstelleIDBAdapter
- Seit:
- 2.0
-
getFieldLength
Beschreibung aus Schnittstelle kopiert:IDBAdapter
Returns the column length for the given database type.- Angegeben von:
getFieldLength
in SchnittstelleIDBAdapter
- Parameter:
type
- theDBType
to check.- Gibt zurück:
- the supported column length for the type.
- Seit:
- 4.2
-
isTypeIndexable
- Angegeben von:
isTypeIndexable
in 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:
isReservedWord
in SchnittstelleIDBAdapter
-
validateTable
- Löst aus:
DBException
- Seit:
- 2.0
-
createFieldDefinitions
- Seit:
- 4.2
-
appendFieldNames
-
appendFieldDefs
- Seit:
- 4.2
-
adaptType
Beschreibung aus Schnittstelle kopiert:IDBAdapter
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.- Angegeben von:
adaptType
in SchnittstelleIDBAdapter
- Seit:
- 3.0
-
isValidFirstChar
public boolean isValidFirstChar(char ch) Beschreibung aus Schnittstelle kopiert:IDBAdapter
Check if a character is valid as first character. (e.g., underscores are forbidden as first character in Derby elements.- Angegeben von:
isValidFirstChar
in SchnittstelleIDBAdapter
- Seit:
- 4.0
-
isDuplicateKeyException
Beschreibung aus Schnittstelle kopiert:IDBAdapter
Check if an exception indicates a constraint violation (duplicate key)- Angegeben von:
isDuplicateKeyException
in SchnittstelleIDBAdapter
- Seit:
- 4.0
-
isTableNotFoundException
- Angegeben von:
isTableNotFoundException
in SchnittstelleIDBAdapter
- Seit:
- 4.2
-
isColumnNotFoundException
- Angegeben von:
isColumnNotFoundException
in SchnittstelleIDBAdapter
- Seit:
- 4.2
-
sqlRenameField
- Angegeben von:
sqlRenameField
in SchnittstelleIDBAdapter
- Seit:
- 4.2
-
sqlModifyField
- Angegeben von:
sqlModifyField
in 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:
getJDBCDriver
in 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:
createJDBCDataSource
in SchnittstelleIDBAdapter
- Seit:
- 4.2
-