Skip to content

Commit

Permalink
Removed Oracle specific code in SQLUtil. This might be a mistake...
Browse files Browse the repository at this point in the history
  • Loading branch information
apavlo committed May 15, 2015
1 parent 22bf02e commit aa8b9b7
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/com/oltpbenchmark/util/SQLUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,18 @@ public static Timestamp getTimestamp(Object obj) {
else if (obj instanceof Date) {
return new Timestamp(((Date)obj).getTime());
}
else if (obj instanceof oracle.sql.TIMESTAMP) {
try {
return ((oracle.sql.TIMESTAMP)obj).timestampValue();
} catch (SQLException ex) {
throw new RuntimeException("Failed to get timestamp from '" + obj + "'", ex);
}
else {
LOG.error(String.format("Unexpected timestamp object type '%s': %s",
obj.getClass().getName(), obj));
}
// FIXME: Not sure how to include this without including Oracle jars
// else if (obj instanceof oracle.sql.TIMESTAMP) {
// try {
// return ((oracle.sql.TIMESTAMP)obj).timestampValue();
// } catch (SQLException ex) {
// throw new RuntimeException("Failed to get timestamp from '" + obj + "'", ex);
// }
// }

Long timestamp = SQLUtil.getLong(obj);
return (timestamp != null ? new Timestamp(timestamp) : null);
Expand Down

0 comments on commit aa8b9b7

Please sign in to comment.