resultset.java
来自「derby database source code.good for you.」· Java 代码 · 共 1,556 行 · 第 1/5 页
JAVA
1,556 行
public float getFloat(int column) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getFloat", column); } checkGetterPreconditions(column); float result = 0; if (wasNonNullSensitiveUpdate(column)) { result = ((Float) agent_.crossConverters_.setObject(java.sql.Types.REAL, updatedColumns_[column - 1])).floatValue(); } else { result = isNull(column) ? 0 : cursor_.getFloat(column); } if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getFloat", result); } setWasNull(column); // Placed close to the return to minimize risk of thread interference return result; } // Live life on the edge and run unsynchronized public double getDouble(int column) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getDouble", column); } checkGetterPreconditions(column); double result = 0; if (wasNonNullSensitiveUpdate(column)) { result = ((Double) agent_.crossConverters_.setObject(java.sql.Types.DOUBLE, updatedColumns_[column - 1])).doubleValue(); } else { result = isNull(column) ? 0 : cursor_.getDouble(column); } if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getDouble", result); } setWasNull(column); // Placed close to the return to minimize risk of thread interference return result; } // Live life on the edge and run unsynchronized public java.math.BigDecimal getBigDecimal(int column, int scale) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceDeprecatedEntry(this, "getBigDecimal", column, scale); } checkGetterPreconditions(column); java.math.BigDecimal result = null; if (wasNonNullSensitiveUpdate(column)) { result = ((java.math.BigDecimal) agent_.crossConverters_.setObject(java.sql.Types.DECIMAL, updatedColumns_[column - 1])).setScale(scale, java.math.BigDecimal.ROUND_DOWN); } else { result = isNull(column) ? null : cursor_.getBigDecimal(column).setScale(scale, java.math.BigDecimal.ROUND_DOWN); } if (agent_.loggingEnabled()) { agent_.logWriter_.traceDeprecatedExit(this, "getBigDecimal", result); } setWasNull(column); // Placed close to the return to minimize risk of thread interference return result; } // Live life on the edge and run unsynchronized public java.math.BigDecimal getBigDecimal(int column) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getBigDecimal", column); } checkGetterPreconditions(column); java.math.BigDecimal result = null; if (wasNonNullSensitiveUpdate(column)) { result = (java.math.BigDecimal) agent_.crossConverters_.setObject(java.sql.Types.DECIMAL, updatedColumns_[column - 1]); } else { result = isNull(column) ? null : cursor_.getBigDecimal(column); } if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getBigDecimal", result); } setWasNull(column); // Placed close to the return to minimize risk of thread interference return result; } // Live life on the edge and run unsynchronized public java.sql.Date getDate(int column) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getDate", column); } checkGetterPreconditions(column); java.sql.Date result = null; if (wasNonNullSensitiveUpdate(column)) { result = (java.sql.Date) agent_.crossConverters_.setObject(java.sql.Types.DATE, updatedColumns_[column - 1]); } else { result = isNull(column) ? null : cursor_.getDate(column); } if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getDate", result); } setWasNull(column); // Placed close to the return to minimize risk of thread interference return result; } // Live life on the edge and run unsynchronized public java.sql.Date getDate(int column, java.util.Calendar calendar) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getDate", column, calendar); } if (calendar == null) { throw new SqlException(agent_.logWriter_, "Invalid parameter: calendar is null"); } java.sql.Date date = getDate(column); if (date != null) { java.util.Calendar targetCalendar = java.util.Calendar.getInstance(calendar.getTimeZone()); targetCalendar.clear(); targetCalendar.setTime(date); java.util.Calendar defaultCalendar = java.util.Calendar.getInstance(); defaultCalendar.clear(); defaultCalendar.setTime(date); long timeZoneOffset = targetCalendar.get(java.util.Calendar.ZONE_OFFSET) - defaultCalendar.get(java.util.Calendar.ZONE_OFFSET) + targetCalendar.get(java.util.Calendar.DST_OFFSET) - defaultCalendar.get(java.util.Calendar.DST_OFFSET); date.setTime(date.getTime() - timeZoneOffset); } if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getDate", date); } return date; } // Live life on the edge and run unsynchronized public java.sql.Time getTime(int column) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getTime", column); } checkGetterPreconditions(column); java.sql.Time result = null; if (wasNonNullSensitiveUpdate(column)) { result = (java.sql.Time) agent_.crossConverters_.setObject(java.sql.Types.TIME, updatedColumns_[column - 1]); } else { result = isNull(column) ? null : cursor_.getTime(column); } if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getTime", result); } setWasNull(column); // Placed close to the return to minimize risk of thread interference return result; } // Live life on the edge and run unsynchronized public java.sql.Time getTime(int column, java.util.Calendar calendar) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getTime", column, calendar); } if (calendar == null) { throw new SqlException(agent_.logWriter_, "Invalid parameter: calendar is null"); } java.sql.Time time = getTime(column); if (time != null) { java.util.Calendar targetCalendar = java.util.Calendar.getInstance(calendar.getTimeZone()); targetCalendar.clear(); targetCalendar.setTime(time); java.util.Calendar defaultCalendar = java.util.Calendar.getInstance(); defaultCalendar.clear(); defaultCalendar.setTime(time); long timeZoneOffset = targetCalendar.get(java.util.Calendar.ZONE_OFFSET) - defaultCalendar.get(java.util.Calendar.ZONE_OFFSET) + targetCalendar.get(java.util.Calendar.DST_OFFSET) - defaultCalendar.get(java.util.Calendar.DST_OFFSET); time.setTime(time.getTime() - timeZoneOffset); } if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getTime", time); } return time; } // Live life on the edge and run unsynchronized public java.sql.Timestamp getTimestamp(int column) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getTimestamp", column); } checkGetterPreconditions(column); java.sql.Timestamp result = null; if (wasNonNullSensitiveUpdate(column)) { result = (java.sql.Timestamp) agent_.crossConverters_.setObject(java.sql.Types.TIMESTAMP, updatedColumns_[column - 1]); } else { result = isNull(column) ? null : cursor_.getTimestamp(column); } if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getTimestamp", result); } setWasNull(column); // Placed close to the return to minimize risk of thread interference return result; } // Live life on the edge and run unsynchronized public java.sql.Timestamp getTimestamp(int column, java.util.Calendar calendar) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getTimestamp", column, calendar); } if (calendar == null) { throw new SqlException(agent_.logWriter_, "Invalid parameter: calendar is null"); } java.sql.Timestamp timestamp = getTimestamp(column); if (timestamp != null) { int nano = timestamp.getNanos(); java.util.Calendar targetCalendar = java.util.Calendar.getInstance(calendar.getTimeZone()); targetCalendar.clear(); targetCalendar.setTime(timestamp); java.util.Calendar defaultCalendar = java.util.Calendar.getInstance(); defaultCalendar.clear(); defaultCalendar.setTime(timestamp); long timeZoneOffset = targetCalendar.get(java.util.Calendar.ZONE_OFFSET) - defaultCalendar.get(java.util.Calendar.ZONE_OFFSET) + targetCalendar.get(java.util.Calendar.DST_OFFSET) - defaultCalendar.get(java.util.Calendar.DST_OFFSET); timestamp.setTime(timestamp.getTime() - timeZoneOffset); timestamp.setNanos(nano); } if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getTimestamp", timestamp); } return timestamp; } // Live life on the edge and run unsynchronized public String getString(int column) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getString", column); } checkGetterPreconditions(column); String result = null; if (wasNonNullSensitiveUpdate(column)) { result = (String) agent_.crossConverters_.setObject(java.sql.Types.CHAR, updatedColumns_[column - 1]); } else { result = isNull(column) ? null : cursor_.getString(column); } if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getString", result); } setWasNull(column); // Placed close to the return to minimize risk of thread interference return result; } // Live life on the edge and run unsynchronized public byte[] getBytes(int column) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getBytes", column); } checkGetterPreconditions(column); byte[] result = null; if (wasNonNullSensitiveUpdate(column)) { result = (byte[]) agent_.crossConverters_.setObject(java.sql.Types.BINARY, updatedColumns_[column - 1]); } else { result = isNull(column) ? null : cursor_.getBytes(column); } if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getBytes", result); } setWasNull(column); // Placed close to the return to minimize risk of thread interference return result; } // Live life on the edge and run unsynchronized public java.io.InputStream getBinaryStream(int column) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getBinaryStream", column); } checkGetterPreconditions(column); java.io.InputStream result = null; if (wasNonNullSensitiveUpdate(column)) { result = new java.io.ByteArrayInputStream((byte[]) agent_.crossConverters_.setObject(java.sql.Types.BINARY, updatedColumns_[column - 1])); } else { result = isNull(column) ? null : cursor_.getBinaryStream(column); } if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getBinaryStream", result); } setWasNull(column); // Placed close to the return to minimize risk of thread interference return result; } // Live life on the edge and run unsynchronized public java.io.InputStream getAsciiStream(int column) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getAsciiStream", column); } checkGetterPreconditions(column); java.io.InputStream result = null; if (wasNonNullSensitiveUpdate(column)) { try { result = new java.io.ByteArrayInputStream (((String) agent_.crossConverters_.setObject(java.sql.Types.CHAR, updatedColumns_[column - 1])).getBytes("US-ASCII")); } catch (java.io.UnsupportedEncodingException e) { throw new SqlException(agent_.logWriter_, e, e.getMessage()); } } else { result = isNull(column) ? null : cursor_.getAsciiStream(column); } if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getAsciiStream", result); } setWasNull(column); // Placed close to the return to minimize risk of thread interference return result; } // Live life on the edge and run unsynchronized public java.io.InputStream getUnicodeStream(int column) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceDeprecatedEntry(this, "getUnicodeStream", column); } checkGetterPreconditions(column); java.io.InputStream result = null; if (wasNonNullSensitiveUpdate(column)) {
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?