@Override public String[] getAddForeignKeySQL(ForeignKey fk) { String fksql = getForeignKeyConstraintSQL(fk); if (fksql == null) return new String[0]; return new String[]{ "ALTER TABLE " + getFullName(fk.getTable(), false) + " ADD CONSTRAINT " + fksql }; }
@Override public String[] getAddPrimaryKeySQL(PrimaryKey pk) { String pksql = getPrimaryKeyConstraintSQL(pk); if (pksql == null) return new String[0]; return new String[]{ "ALTER TABLE " + getFullName(pk.getTable(), false) + " ADD CONSTRAINT " + pksql }; }
@Override public boolean isFatalException(int subtype, SQLException ex) { // SQL State of IX000 is a general purpose Informix error code // category, so only return Boolean.TRUE if we match SQL Codes // recoverable = Boolean.FALSE; if ((subtype == StoreException.LOCK && checkNestedErrorCodes(ex, "IX000", -154)) ||(subtype == StoreException.QUERY && ex.getErrorCode() == -213)) { return false; } return super.isFatalException(subtype, ex); }
@Override public Index newIndex(ResultSet idxMeta) throws SQLException { Index idx = super.newIndex(idxMeta); if (swapSchemaAndCatalog) idx.setSchemaIdentifier(fromDBName(idxMeta.getString("TABLE_CAT"), DBIdentifierType.CATALOG)); return idx; }
@Override public Column[] getColumns(DatabaseMetaData meta, String catalog, String schemaName, String tableName, String columnName, Connection conn) throws SQLException { return getColumns(meta, DBIdentifier.newCatalog(catalog), DBIdentifier.newSchema(schemaName),DBIdentifier.newTable(tableName), DBIdentifier.newColumn(columnName), conn); }
private void setIdentifierCase(DatabaseMetaData meta) { try { // lower case identifiers is the default for the JCC and newer // Informix JDBC drivers if (meta.storesLowerCaseIdentifiers()) { schemaCase = SCHEMA_CASE_LOWER; } else if (meta.storesMixedCaseIdentifiers()) { schemaCase = SCHEMA_CASE_PRESERVE; } // otherwise, use the default (upper) } catch (SQLException e) { getLog().warn("cannot-determine-identifier-base-case"); if (getLog().isTraceEnabled()) { getLog().trace(e.toString(), e); } } }
setIdentifierCase(meta); setIdentifierCase(meta); driverVendor = VENDOR_IBM;
@Override public PrimaryKey newPrimaryKey(ResultSet pkMeta) throws SQLException { PrimaryKey pk = super.newPrimaryKey(pkMeta); if (swapSchemaAndCatalog) pk.setSchemaIdentifier(fromDBName(pkMeta.getString("TABLE_CAT"), DBIdentifierType.CATALOG)); return pk; }
@Override public Column[] getColumns(DatabaseMetaData meta, String catalog, String schemaName, String tableName, String columnName, Connection conn) throws SQLException { return getColumns(meta, DBIdentifier.newCatalog(catalog), DBIdentifier.newSchema(schemaName),DBIdentifier.newTable(tableName), DBIdentifier.newColumn(columnName), conn); }
private void setIdentifierCase(DatabaseMetaData meta) { try { // lower case identifiers is the default for the JCC and newer // Informix JDBC drivers if (meta.storesLowerCaseIdentifiers()) { schemaCase = SCHEMA_CASE_LOWER; } else if (meta.storesMixedCaseIdentifiers()) { schemaCase = SCHEMA_CASE_PRESERVE; } // otherwise, use the default (upper) } catch (SQLException e) { getLog().warn("cannot-determine-identifier-base-case"); if (getLog().isTraceEnabled()) { getLog().trace(e.toString(), e); } } }
setIdentifierCase(meta); setIdentifierCase(meta); driverVendor = VENDOR_IBM;
@Override public String[] getAddForeignKeySQL(ForeignKey fk) { String fksql = getForeignKeyConstraintSQL(fk); if (fksql == null) return new String[0]; return new String[]{ "ALTER TABLE " + getFullName(fk.getTable(), false) + " ADD CONSTRAINT " + fksql }; }
public String[] getAddPrimaryKeySQL(PrimaryKey pk) { String pksql = getPrimaryKeyConstraintSQL(pk); if (pksql == null) return new String[0]; return new String[]{ "ALTER TABLE " + getFullName(pk.getTable(), false) + " ADD CONSTRAINT " + pksql }; }
@Override public Index newIndex(ResultSet idxMeta) throws SQLException { Index idx = super.newIndex(idxMeta); if (swapSchemaAndCatalog) idx.setSchemaIdentifier(fromDBName(idxMeta.getString("TABLE_CAT"), DBIdentifierType.CATALOG)); return idx; }
@Override public boolean isFatalException(int subtype, SQLException ex) { // SQL State of IX000 is a general purpose Informix error code // category, so only return Boolean.TRUE if we match SQL Codes // recoverable = Boolean.FALSE; if ((subtype == StoreException.LOCK && checkNestedErrorCodes(ex, "IX000", -154)) ||(subtype == StoreException.QUERY && ex.getErrorCode() == -213)) { return false; } return super.isFatalException(subtype, ex); }
@Override public Column[] getColumns(DatabaseMetaData meta, String catalog, String schemaName, String tableName, String columnName, Connection conn) throws SQLException { return getColumns(meta, DBIdentifier.newCatalog(catalog), DBIdentifier.newSchema(schemaName),DBIdentifier.newTable(tableName), DBIdentifier.newColumn(columnName), conn); }
private void setIdentifierCase(DatabaseMetaData meta) { try { // lower case identifiers is the default for the JCC and newer // Informix JDBC drivers if (meta.storesLowerCaseIdentifiers()) { schemaCase = SCHEMA_CASE_LOWER; } else if (meta.storesMixedCaseIdentifiers()) { schemaCase = SCHEMA_CASE_PRESERVE; } // otherwise, use the default (upper) } catch (SQLException e) { getLog().warn("cannot-determine-identifier-base-case"); if (getLog().isTraceEnabled()) { getLog().trace(e.toString(), e); } } }
setIdentifierCase(meta); setIdentifierCase(meta); driverVendor = VENDOR_IBM;