mirror of https://github.com/apache/openjpa.git
OPENJPA-644 Handle databaseProductVersion string from newer jcc driver for DB2 ISeries
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@672008 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
82e61ba0d5
commit
e3dbdac159
|
@ -438,9 +438,14 @@ public class DB2Dictionary
|
|||
// (Toolbox)DBProdVersion 05.04.0000 V5R4m0
|
||||
// ISeries DB2 UDB for AS/400
|
||||
// (Native) V5R4M0
|
||||
// new jcc DBProdVersion QSQ05040 or QSQ06010
|
||||
if (databaseProductName.indexOf("AS") != -1) {
|
||||
String s = databaseProductVersion.substring(databaseProductVersion
|
||||
.indexOf('V'));
|
||||
// default to V5R4
|
||||
maj = 5;
|
||||
min = 4;
|
||||
int index = databaseProductVersion.indexOf('V');
|
||||
if (index != -1) {
|
||||
String s = databaseProductVersion.substring(index);
|
||||
s = s.toUpperCase();
|
||||
|
||||
StringTokenizer stringtokenizer = new StringTokenizer(s, "VRM"
|
||||
|
@ -452,6 +457,23 @@ public class DB2Dictionary
|
|||
min = Integer.parseInt(s2);
|
||||
}
|
||||
}
|
||||
else {
|
||||
index = databaseProductVersion.indexOf('0');
|
||||
if (index != -1) {
|
||||
String s = databaseProductVersion.substring(index);
|
||||
s = s.toUpperCase();
|
||||
|
||||
StringTokenizer stringtokenizer = new StringTokenizer(s, "0"
|
||||
, false);
|
||||
if (stringtokenizer.countTokens() == 2) {
|
||||
String s1 = stringtokenizer.nextToken();
|
||||
maj = Integer.parseInt(s1);
|
||||
String s2 = stringtokenizer.nextToken();
|
||||
min = Integer.parseInt(s2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getProductVersionMajorMinor() {
|
||||
|
|
Loading…
Reference in New Issue