further clean up for OPENJPA-222

git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@530174 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David J. Wisneski 2007-04-18 21:58:16 +00:00
parent 0df6a69703
commit 30f2042510
1 changed files with 6 additions and 7 deletions

View File

@ -39,7 +39,7 @@ public class DB2Dictionary
private int db2ServerType = 0;
private static final int db2ISeriesV5R3AndEarlier = 1;
private static final int db2UDBV81OrEarlier = 2;
private static final int db2ZOSV8x = 3;
private static final int db2ZOSV8xOrLater = 3;
private static final int db2UDBV82AndLater = 4;
private static final int db2ISeriesV5R4AndLater = 5;
private static final String forUpdateOfClause = "FOR UPDATE OF";
@ -195,8 +195,8 @@ public class DB2Dictionary
db2ServerType = db2ISeriesV5R3AndEarlier;
else if (isDB2UDBV81OrEarlier(metaData,maj,min))
db2ServerType = db2UDBV81OrEarlier;
else if (isDB2ZOSV8x(metaData,maj))
db2ServerType = db2ZOSV8x;
else if (isDB2ZOSV8xOrLater(metaData,maj))
db2ServerType = db2ZOSV8xOrLater;
else if (isDB2UDBV82AndLater(metaData,maj,min))
db2ServerType = db2UDBV82AndLater;
else if (isDB2ISeriesV5R4AndLater(metaData))
@ -246,7 +246,6 @@ public class DB2Dictionary
isolationLevel = conf.getTransactionIsolationConstant();
if (forUpdate) {
switch(db2ServerType) {
case db2ISeriesV5R3AndEarlier:
case db2UDBV81OrEarlier:
@ -259,7 +258,7 @@ public class DB2Dictionary
.append(" ");
}
break;
case db2ZOSV8x:
case db2ZOSV8xOrLater:
case db2UDBV82AndLater:
if (isolationLevel == Connection.TRANSACTION_SERIALIZABLE) {
forUpdateString.append(" ").append(forReadOnlyClause)
@ -305,11 +304,11 @@ public class DB2Dictionary
return match;
}
public boolean isDB2ZOSV8x(DatabaseMetaData metadata, int maj)
public boolean isDB2ZOSV8xOrLater(DatabaseMetaData metadata, int maj)
throws SQLException {
boolean match = false;
if (metadata.getDatabaseProductVersion().indexOf("DSN") != -1
&& maj == 8)
&& maj >= 8)
match = true;
return match;
}