/** * INTERNAL: * Get a TIMESTAMPLTZ value from a result set. */ public Object getTIMESTAMPLTZFromResultSet(ResultSet resultSet, int columnNumber, int type, AbstractSession session) throws java.sql.SQLException { //TIMESTAMPLTZ needs to be converted to Timestamp here because it requires the connection. //However the java object is not know here. The solution is to store Timestamp and the //session timezone in a wrapper class, which will be used later in converObject(). TIMESTAMPLTZ tsLTZ = (TIMESTAMPLTZ)resultSet.getObject(columnNumber); if ((tsLTZ != null) && (tsLTZ.getLength() != 0)) { Connection connection = getConnection(session, resultSet.getStatement().getConnection()); Timestamp timestampToWrap = TIMESTAMPLTZ.toTimestamp(connection, tsLTZ.toBytes()); String sessionTimeZone = ((OracleConnection)connection).getSessionTimeZone(); //Bug#4364359 Add a separate wrapper for TIMESTAMPLTZ. return new TIMESTAMPLTZWrapper(timestampToWrap, sessionTimeZone, this.isLtzTimestampInGmt); } return null; }
/** * INTERNAL: * Get a TIMESTAMPLTZ value from a result set. */ public Object getTIMESTAMPLTZFromResultSet(ResultSet resultSet, int columnNumber, int type, AbstractSession session) throws java.sql.SQLException { //TIMESTAMPLTZ needs to be converted to Timestamp here because it requires the connection. //However the java object is not know here. The solution is to store Timestamp and the //session timezone in a wrapper class, which will be used later in converObject(). TIMESTAMPLTZ tsLTZ = (TIMESTAMPLTZ)resultSet.getObject(columnNumber); if ((tsLTZ != null) && (tsLTZ.getLength() != 0)) { Connection connection = getConnection(session, resultSet.getStatement().getConnection()); Timestamp timestampToWrap = TIMESTAMPLTZ.toTimestamp(connection, tsLTZ.toBytes()); String sessionTimeZone = ((OracleConnection)connection).getSessionTimeZone(); //Bug#4364359 Add a separate wrapper for TIMESTAMPLTZ. return new TIMESTAMPLTZWrapper(timestampToWrap, sessionTimeZone, this.isLtzTimestampInGmt); } return null; }