mirror of https://github.com/apache/openjpa.git
OPENJPA-973: allow DB2 jcc driver to access Informix
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@757512 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b546423063
commit
31ae580252
|
@ -73,6 +73,7 @@ public class InformixDictionary
|
||||||
*/
|
*/
|
||||||
public boolean swapSchemaAndCatalog = true;
|
public boolean swapSchemaAndCatalog = true;
|
||||||
|
|
||||||
|
protected boolean useJCC = false;
|
||||||
// weak set of connections we've already executed lock mode sql on
|
// weak set of connections we've already executed lock mode sql on
|
||||||
private final Collection _seenConnections = new ReferenceHashSet
|
private final Collection _seenConnections = new ReferenceHashSet
|
||||||
(ReferenceHashSet.WEAK);
|
(ReferenceHashSet.WEAK);
|
||||||
|
@ -155,10 +156,19 @@ public class InformixDictionary
|
||||||
super.connectedConfiguration(conn);
|
super.connectedConfiguration(conn);
|
||||||
if (driverVendor == null) {
|
if (driverVendor == null) {
|
||||||
DatabaseMetaData meta = conn.getMetaData();
|
DatabaseMetaData meta = conn.getMetaData();
|
||||||
if ("Informix".equalsIgnoreCase(meta.getDriverName()))
|
String driverName = meta.getDriverName();
|
||||||
|
if ("Informix".equalsIgnoreCase(driverName))
|
||||||
driverVendor = VENDOR_DATADIRECT;
|
driverVendor = VENDOR_DATADIRECT;
|
||||||
else
|
else
|
||||||
driverVendor = VENDOR_OTHER;
|
driverVendor = VENDOR_OTHER;
|
||||||
|
|
||||||
|
if (driverName.equals("IBM DB2 JDBC Universal Driver Architecture")) {
|
||||||
|
useJCC = true;
|
||||||
|
try {
|
||||||
|
if (meta.storesLowerCaseIdentifiers())
|
||||||
|
schemaCase = SCHEMA_CASE_LOWER;
|
||||||
|
} catch (SQLException e) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (isJDBC3) {
|
if (isJDBC3) {
|
||||||
conn.setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT);
|
conn.setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT);
|
||||||
|
@ -301,4 +311,17 @@ public class InformixDictionary
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean useJCC() {
|
||||||
|
return useJCC;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return DB specific schemaCase
|
||||||
|
*/
|
||||||
|
public String getSchemaCase(){
|
||||||
|
return schemaCase;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue