亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? resultsetrow.java

?? 用于JAVA數據庫連接.解壓就可用,方便得很
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/*
 Copyright (C) 2007 MySQL AB

 This program is free software; you can redistribute it and/or modify
 it under the terms of version 2 of the GNU General Public License as 
 published by the Free Software Foundation.

 There are special exceptions to the terms and conditions of the GPL 
 as it is applied to this software. View the full text of the 
 exception in file EXCEPTIONS-CONNECTOR-J in the directory of this 
 software distribution.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 */
package com.mysql.jdbc;

import java.io.InputStream;
import java.io.Reader;
import java.sql.Date;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Time;
import java.sql.Timestamp;
import java.sql.Types;
import java.util.Calendar;
import java.util.StringTokenizer;
import java.util.TimeZone;

/**
 * Classes that implement this interface represent one row of data from the
 * MySQL server that might be stored in different ways depending on whether the
 * result set was streaming (so they wrap a reusable packet), or whether the
 * result set was cached or via a server-side cursor (so they represent a
 * byte[][]).
 * 
 * Notice that <strong>no</strong> bounds checking is expected for implementors
 * of this interface, it happens in ResultSetImpl.
 * 
 * @version $Id: $
 */
public abstract class ResultSetRow {
	/**
	 * The metadata of the fields of this result set.
	 */
	protected Field[] metadata;

	/**
	 * Called during navigation to next row to close all open
	 * streams.
	 */
	public abstract void closeOpenStreams();

	/**
	 * Returns data at the given index as an InputStream with no
	 * character conversion.
	 * 
	 * @param columnIndex
	 *            of the column value (starting at 0) to return.
	 * @return the value at the given index as an InputStream or null
	 *         if null.
	 *         
	 * @throws SQLException if an error occurs while retrieving the value.
	 */
	public abstract InputStream getBinaryInputStream(int columnIndex)
			throws SQLException;

	/**
	 * Returns the value at the given column (index starts at 0) "raw" (i.e.
	 * as-returned by the server).
	 * 
	 * @param index
	 *            of the column value (starting at 0) to return.
	 * @return the value for the given column (including NULL if it is)
	 * @throws SQLException
	 *             if an error occurs while retrieving the value.
	 */
	public abstract byte[] getColumnValue(int index) throws SQLException;

	protected final java.sql.Date getDateFast(int columnIndex,
			byte[] dateAsBytes, int offset, int length, ConnectionImpl conn,
			ResultSetImpl rs) throws SQLException {

		int year = 0;
		int month = 0;
		int day = 0;

		try {
			if (dateAsBytes == null) {
				return null;
			}

			boolean allZeroDate = true;

			boolean onlyTimePresent = false;

			for (int i = 0; i < length; i++) {
				if (dateAsBytes[offset + i] == ':') {
					onlyTimePresent = true;
					break;
				}
			}

			for (int i = 0; i < length; i++) {
				byte b = dateAsBytes[offset + i];

				if (b == ' ' || b == '-' || b == '/') {
					onlyTimePresent = false;
				}

				if (b != '0' && b != ' ' && b != ':' && b != '-' && b != '/'
						&& b != '.') {
					allZeroDate = false;

					break;
				}
			}

			if (!onlyTimePresent && allZeroDate) {

				if (ConnectionPropertiesImpl.ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL
						.equals(conn.getZeroDateTimeBehavior())) {

					return null;
				} else if (ConnectionPropertiesImpl.ZERO_DATETIME_BEHAVIOR_EXCEPTION
						.equals(conn.getZeroDateTimeBehavior())) {
					throw SQLError.createSQLException("Value '"
							+ new String(dateAsBytes)
							+ "' can not be represented as java.sql.Date",
							SQLError.SQL_STATE_ILLEGAL_ARGUMENT);
				}

				// We're left with the case of 'round' to a date Java _can_
				// represent, which is '0001-01-01'.
				return rs.fastDateCreate(null, 1, 1, 1);

			} else if (this.metadata[columnIndex].getMysqlType() == MysqlDefs.FIELD_TYPE_TIMESTAMP) {
				// Convert from TIMESTAMP
				switch (length) {
				case 21:
				case 19: { // java.sql.Timestamp format
					year = StringUtils.getInt(dateAsBytes, offset + 0,
							offset + 4);
					month = StringUtils.getInt(dateAsBytes, offset + 5,
							offset + 7);
					day = StringUtils.getInt(dateAsBytes, offset + 8,
							offset + 10);

					return rs.fastDateCreate(null, year, month, day);
				}

				case 14:
				case 8: {
					year = StringUtils.getInt(dateAsBytes, offset + 0,
							offset + 4);
					month = StringUtils.getInt(dateAsBytes, offset + 4,
							offset + 6);
					day = StringUtils.getInt(dateAsBytes, offset + 6,
							offset + 8);

					return rs.fastDateCreate(null, year, month, day);
				}

				case 12:
				case 10:
				case 6: {
					year = StringUtils.getInt(dateAsBytes, offset + 0,
							offset + 2);

					if (year <= 69) {
						year = year + 100;
					}

					month = StringUtils.getInt(dateAsBytes, offset + 2,
							offset + 4);
					day = StringUtils.getInt(dateAsBytes, offset + 4,
							offset + 6);

					return rs.fastDateCreate(null, year + 1900, month, day);
				}

				case 4: {
					year = StringUtils.getInt(dateAsBytes, offset + 0,
							offset + 4);

					if (year <= 69) {
						year = year + 100;
					}

					month = StringUtils.getInt(dateAsBytes, offset + 2,
							offset + 4);

					return rs.fastDateCreate(null, year + 1900, month, 1);
				}

				case 2: {
					year = StringUtils.getInt(dateAsBytes, offset + 0,
							offset + 2);

					if (year <= 69) {
						year = year + 100;
					}

					return rs.fastDateCreate(null, year + 1900, 1, 1);
				}

				default:
					throw SQLError
							.createSQLException(
									Messages
											.getString(
													"ResultSet.Bad_format_for_Date",
													new Object[] {
															new String(
																	dateAsBytes),
															Constants
																	.integerValueOf(columnIndex + 1) }),
									SQLError.SQL_STATE_ILLEGAL_ARGUMENT); //$NON-NLS-1$
				} /* endswitch */
			} else if (this.metadata[columnIndex].getMysqlType() == MysqlDefs.FIELD_TYPE_YEAR) {

				if (length == 2 || length == 1) {
					year = StringUtils.getInt(dateAsBytes, offset, offset
							+ length);

					if (year <= 69) {
						year = year + 100;
					}

					year += 1900;
				} else {
					year = StringUtils.getInt(dateAsBytes, offset + 0,
							offset + 4);
				}

				return rs.fastDateCreate(null, year, 1, 1);
			} else if (this.metadata[columnIndex].getMysqlType() == MysqlDefs.FIELD_TYPE_TIME) {
				return rs.fastDateCreate(null, 1970, 1, 1); // Return EPOCH
			} else {
				if (length < 10) {
					if (length == 8) {
						return rs.fastDateCreate(null, 1970, 1, 1); // Return
						// EPOCH for
						// TIME
					}

					throw SQLError
							.createSQLException(
									Messages
											.getString(
													"ResultSet.Bad_format_for_Date",
													new Object[] {
															new String(
																	dateAsBytes),
															Constants
																	.integerValueOf(columnIndex + 1) }),
									SQLError.SQL_STATE_ILLEGAL_ARGUMENT); //$NON-NLS-1$
				}

				if (length != 18) {
					year = StringUtils.getInt(dateAsBytes, offset + 0,
							offset + 4);
					month = StringUtils.getInt(dateAsBytes, offset + 5,
							offset + 7);
					day = StringUtils.getInt(dateAsBytes, offset + 8,
							offset + 10);
				} else {
					// JDK-1.3 timestamp format, not real easy to parse
					// positionally :p
					StringTokenizer st = new StringTokenizer(new String(
							dateAsBytes, offset, length, "ISO8859_1"), "- ");

					year = Integer.parseInt(st.nextToken());
					month = Integer.parseInt(st.nextToken());
					day = Integer.parseInt(st.nextToken());
				}
			}

			return rs.fastDateCreate(null, year, month, day);
		} catch (SQLException sqlEx) {
			throw sqlEx; // don't re-wrap
		} catch (Exception e) {
			throw SQLError.createSQLException(Messages.getString(
					"ResultSet.Bad_format_for_Date", new Object[] {
							new String(dateAsBytes),
							Constants.integerValueOf(columnIndex + 1) }),
					SQLError.SQL_STATE_ILLEGAL_ARGUMENT); //$NON-NLS-1$
		}
	}

	public abstract java.sql.Date getDateFast(int columnIndex,
			ConnectionImpl conn, ResultSetImpl rs) throws SQLException;

	/**
	 * Returns the value at the given column (index starts at 0) as an int. *
	 * 
	 * @param index
	 *            of the column value (starting at 0) to return.
	 * @return the value for the given column (returns 0 if NULL, use isNull()
	 *         to determine if the value was actually NULL)
	 * @throws SQLException
	 *             if an error occurs while retrieving the value.
	 */
	public abstract int getInt(int columnIndex) throws SQLException;

	/**
	 * Returns the value at the given column (index starts at 0) as a long. *
	 * 
	 * @param index
	 *            of the column value (starting at 0) to return.
	 * @return the value for the given column (returns 0 if NULL, use isNull()
	 *         to determine if the value was actually NULL)
	 * @throws SQLException
	 *             if an error occurs while retrieving the value.
	 */
	public abstract long getLong(int columnIndex) throws SQLException;

	protected java.sql.Date getNativeDate(int columnIndex, byte[] bits,
			int offset, int length, ConnectionImpl conn, ResultSetImpl rs)
			throws SQLException {

		int year = 0;
		int month = 0;
		int day = 0;

		if (length != 0) {
			year = (bits[offset + 0] & 0xff) | ((bits[offset + 1] & 0xff) << 8);

			month = bits[offset + 2];
			day = bits[offset + 3];
		}

		if ((year == 0) && (month == 0) && (day == 0)) {
			if (ConnectionPropertiesImpl.ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL
					.equals(conn.getZeroDateTimeBehavior())) {
				return null;
			} else if (ConnectionPropertiesImpl.ZERO_DATETIME_BEHAVIOR_EXCEPTION
					.equals(conn.getZeroDateTimeBehavior())) {
				throw SQLError
						.createSQLException(
								"Value '0000-00-00' can not be represented as java.sql.Date",
								SQLError.SQL_STATE_ILLEGAL_ARGUMENT);
			}

			year = 1;
			month = 1;
			day = 1;
		}

		return rs.fastDateCreate(rs.getCalendarInstanceForSessionOrNew(), year,
				month, day);
	}

	public abstract Date getNativeDate(int columnIndex, ConnectionImpl conn,
			ResultSetImpl rs) throws SQLException;

	protected Object getNativeDateTimeValue(int columnIndex, byte[] bits,
			int offset, int length, Calendar targetCalendar, int jdbcType,
			int mysqlType, TimeZone tz, boolean rollForward, ConnectionImpl conn,
			ResultSetImpl rs) throws SQLException {

		int year = 0;
		int month = 0;
		int day = 0;

		int hour = 0;
		int minute = 0;
		int seconds = 0;

		int nanos = 0;

		if (bits == null) {

			return null;
		}

		Calendar sessionCalendar = conn.getUseJDBCCompliantTimezoneShift() ? conn
				.getUtcCalendar()
				: rs.getCalendarInstanceForSessionOrNew();

		boolean populatedFromDateTimeValue = false;

		switch (mysqlType) {
		case MysqlDefs.FIELD_TYPE_DATETIME:
		case MysqlDefs.FIELD_TYPE_TIMESTAMP:
			populatedFromDateTimeValue = true;

			if (length != 0) {
				year = (bits[offset + 0] & 0xff)
						| ((bits[offset + 1] & 0xff) << 8);
				month = bits[offset + 2];
				day = bits[offset + 3];

				if (length > 4) {
					hour = bits[offset + 4];
					minute = bits[offset + 5];
					seconds = bits[offset + 6];
				}

				if (length > 7) {
					// MySQL uses microseconds
					nanos = ((bits[offset + 7] & 0xff)
							| ((bits[offset + 8] & 0xff) << 8)
							| ((bits[offset + 9] & 0xff) << 16) | ((bits[offset + 10] & 0xff) << 24)) * 1000;
				}
			}

			break;
		case MysqlDefs.FIELD_TYPE_DATE:
			populatedFromDateTimeValue = true;

			if (bits.length != 0) {
				year = (bits[offset + 0] & 0xff)
						| ((bits[offset + 1] & 0xff) << 8);
				month = bits[offset + 2];
				day = bits[offset + 3];
			}

			break;
		case MysqlDefs.FIELD_TYPE_TIME:
			populatedFromDateTimeValue = true;

			if (bits.length != 0) {
				// bits[0] // skip tm->neg
				// binaryData.readLong(); // skip daysPart
				hour = bits[offset + 5];
				minute = bits[offset + 6];
				seconds = bits[offset + 7];
			}

			year = 1970;
			month = 1;
			day = 1;

			break;
		default:
			populatedFromDateTimeValue = false;
		}

		switch (jdbcType) {
		case Types.TIME:
			if (populatedFromDateTimeValue) {
				Time time = TimeUtil.fastTimeCreate(rs
						.getCalendarInstanceForSessionOrNew(), hour, minute,
						seconds);

				Time adjustedTime = TimeUtil.changeTimezone(conn,
						sessionCalendar, targetCalendar, time, conn
								.getServerTimezoneTZ(), tz, rollForward);

				return adjustedTime;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日本一区二区| 欧美电影一区二区三区| 国产片一区二区| 国产成人啪免费观看软件| 日本一区二区三区在线观看| 国产成人自拍高清视频在线免费播放| 久久久亚洲午夜电影| 国产精品99久久久| 成人免费视频在线观看| 色88888久久久久久影院按摩 | 日韩精品一区二区三区视频| 麻豆免费精品视频| 国产欧美综合在线观看第十页| eeuss国产一区二区三区| 一二三区精品视频| 日韩免费看的电影| 成人av资源网站| 亚洲国产欧美日韩另类综合| 日韩一级精品视频在线观看| 国产精品69毛片高清亚洲| 亚洲靠逼com| 精品久久久三级丝袜| 欧美色综合网站| 亚洲h精品动漫在线观看| 久久久久久久国产精品影院| 色婷婷精品大在线视频| 看电影不卡的网站| 一区二区三区自拍| 精品国一区二区三区| 色婷婷综合久色| 精品一区二区免费看| 亚洲精品美国一| 精品999在线播放| 欧美日韩在线亚洲一区蜜芽| 国产精品系列在线播放| 日韩高清中文字幕一区| 日韩一区在线播放| 91免费精品国自产拍在线不卡| 毛片av一区二区| 一区二区久久久久久| 亚洲国产激情av| 日韩欧美一级精品久久| 在线观看中文字幕不卡| 国产99一区视频免费| 日本欧美一区二区三区| 有坂深雪av一区二区精品| 久久婷婷一区二区三区| 91精品国产综合久久久蜜臀粉嫩| av电影在线观看一区| 韩国午夜理伦三级不卡影院| 丝袜美腿亚洲综合| 一区二区三区在线播放| 国产精品国产三级国产有无不卡 | 久久成人免费日本黄色| 亚洲sss视频在线视频| 亚洲视频精选在线| 亚洲国产成人在线| 久久精品视频一区| 2021国产精品久久精品| 日韩一级视频免费观看在线| 欧美日韩国产乱码电影| 在线免费不卡视频| 91片黄在线观看| 91丝袜美腿高跟国产极品老师| 成人午夜在线播放| 国产成a人亚洲| 国产成人精品亚洲日本在线桃色 | 亚洲777理论| 亚洲福利一区二区三区| 亚洲综合色成人| 亚洲伊人色欲综合网| 亚洲小少妇裸体bbw| 亚洲最新在线观看| 亚洲 欧美综合在线网络| 亚洲电影欧美电影有声小说| 亚洲午夜免费电影| 香蕉久久一区二区不卡无毒影院| 一区二区三区在线视频观看58| 最新国产精品久久精品| 亚洲美女淫视频| 香蕉成人伊视频在线观看| 三级精品在线观看| 精品一区二区三区蜜桃| 九色综合狠狠综合久久| 国产宾馆实践打屁股91| 99久久99久久精品国产片果冻| 91国产丝袜在线播放| 欧美精品乱码久久久久久| 日韩欧美国产高清| 久久久久久电影| 日韩毛片视频在线看| 亚洲女人的天堂| 视频在线观看一区二区三区| 免费在线看成人av| 国产大陆亚洲精品国产| 91麻豆国产福利精品| 欧美老女人第四色| 久久亚洲春色中文字幕久久久| 国产欧美日韩另类视频免费观看| 亚洲婷婷综合久久一本伊一区| 一区二区三区中文在线观看| 婷婷综合久久一区二区三区| 久久99久久99| 成人污视频在线观看| 欧美日韩亚洲国产综合| 精品乱人伦一区二区三区| 国产目拍亚洲精品99久久精品| 亚洲免费av高清| 久色婷婷小香蕉久久| 94-欧美-setu| 欧美一区二区三区四区视频| 国产亚洲欧美激情| 亚洲一级二级三级| 国产在线精品一区在线观看麻豆| 99久久久国产精品免费蜜臀| 91.xcao| 国产精品欧美一区喷水| 亚洲无线码一区二区三区| av不卡在线播放| 色综合久久久久久久久| 日韩丝袜美女视频| 国产精品不卡一区| 喷白浆一区二区| 91丨porny丨蝌蚪视频| 日韩丝袜情趣美女图片| 亚洲免费成人av| 国产在线精品免费| 91精品国产入口| 亚洲人成在线播放网站岛国| 久久av资源站| 在线播放91灌醉迷j高跟美女| 国产蜜臀av在线一区二区三区| 偷拍与自拍一区| 91久久精品午夜一区二区| 久久久久99精品一区| 免费成人av在线| 欧美亚日韩国产aⅴ精品中极品| 国产欧美日韩亚州综合| 精一区二区三区| 91精品福利在线一区二区三区| 亚洲免费看黄网站| 成人白浆超碰人人人人| 精品国产伦一区二区三区观看体验| 亚洲午夜视频在线观看| 91美女在线视频| 国产精品久久综合| 成人午夜伦理影院| 久久免费精品国产久精品久久久久 | 一区二区三区四区不卡在线| 国产精品综合在线视频| 欧美一级专区免费大片| 性久久久久久久久久久久| 91精品国产综合久久香蕉麻豆| 日韩毛片在线免费观看| 成人理论电影网| 欧美激情综合五月色丁香小说| 激情综合五月天| 欧美不卡激情三级在线观看| 丝袜美腿亚洲综合| 在线成人小视频| 五月婷婷欧美视频| 欧美伊人久久大香线蕉综合69| 国产精品国模大尺度视频| 成人美女在线视频| 国产精品日产欧美久久久久| 国产麻豆欧美日韩一区| 久久亚区不卡日本| 国产一区二区日韩精品| 精品国产一区二区亚洲人成毛片| 美女国产一区二区| 日韩精品中文字幕一区| 激情另类小说区图片区视频区| 久久影院电视剧免费观看| 国产一区二区三区免费| 国产蜜臀av在线一区二区三区| 丁香激情综合五月| 亚洲日本va午夜在线电影| 欧美在线看片a免费观看| 亚洲成av人片| 日韩欧美中文一区| 国产精品99久久久久久久女警| 中文字幕乱码一区二区免费| 不卡欧美aaaaa| 亚洲国产精品久久久久婷婷884| 欧美日韩亚洲高清一区二区| 免费成人美女在线观看.| 久久久久久久免费视频了| 波多野结衣一区二区三区| 亚洲一区二区黄色| 精品剧情在线观看| 丁香六月久久综合狠狠色| 亚洲久本草在线中文字幕| 91精品综合久久久久久| 国产精品一二三区| 亚洲综合一二区| 久久亚洲一级片| 91丨porny丨在线| 蜜臀a∨国产成人精品| 国产精品久久久爽爽爽麻豆色哟哟| 欧美性色黄大片|