mirror of https://github.com/apache/openjpa.git
Revert "OPENJPA-2745: Clean up try-catch implementation for DB2Dictionary"
This reverts commit fadcf7652f
.
This commit is contained in:
parent
30e1b2a4a9
commit
2cf0eaca21
|
@ -1023,9 +1023,11 @@ public class DB2Dictionary
|
||||||
return (byte[]) rs.getObject(column);
|
return (byte[]) rs.getObject(column);
|
||||||
}
|
}
|
||||||
|
|
||||||
int type = rs.getMetaData().getColumnType(column);
|
// At this point we don't have any idea if the DB2 column was defined as
|
||||||
switch (type) {
|
// a blob or if it was defined as CHAR for BIT DATA.
|
||||||
case Types.BLOB:
|
// First try as a blob, if that doesn't work, then try as CHAR for BIT DATA
|
||||||
|
// If that doesn't work, then go ahead and throw the first exception
|
||||||
|
try {
|
||||||
Blob blob = getBlob(rs, column);
|
Blob blob = getBlob(rs, column);
|
||||||
if (blob == null) {
|
if (blob == null) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -1035,11 +1037,17 @@ public class DB2Dictionary
|
||||||
if (length == 0) {
|
if (length == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return blob.getBytes(1, length);
|
return blob.getBytes(1, length);
|
||||||
case Types.BINARY:
|
}
|
||||||
default:
|
catch (SQLException e) {
|
||||||
|
try {
|
||||||
return rs.getBytes(column);
|
return rs.getBytes(column);
|
||||||
}
|
}
|
||||||
|
catch (SQLException e2) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getCastStringColumnSize(Object val) {
|
private int getCastStringColumnSize(Object val) {
|
||||||
|
|
Loading…
Reference in New Issue