亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美成人福利视频| 亚洲最新视频在线观看| 精品国产免费一区二区三区香蕉| 9191成人精品久久| 日韩一区二区中文字幕| 日韩美一区二区三区| 日韩精品最新网址| 精品日韩av一区二区| 亚洲精品在线免费播放| 久久精品人人爽人人爽| 国产网红主播福利一区二区| 国产无一区二区| 综合欧美一区二区三区| 亚洲激情图片一区| 五月天激情综合网| 懂色av一区二区夜夜嗨| 国产美女一区二区| 成人国产电影网| 91蜜桃在线观看| 欧美日本一区二区在线观看| 9191久久久久久久久久久| 日韩欧美一级精品久久| 久久精品网站免费观看| 国产精品成人一区二区艾草 | 《视频一区视频二区| 日韩美女精品在线| 亚洲一二三区视频在线观看| 蜜桃精品在线观看| 丁香桃色午夜亚洲一区二区三区| 播五月开心婷婷综合| 欧美日韩精品一区二区在线播放| 欧美一区二区三区小说| 国产亲近乱来精品视频| 一区二区三区加勒比av| 美女性感视频久久| 成人一区二区视频| 欧美日韩国产成人在线免费| 精品乱人伦一区二区三区| 中文字幕第一区二区| 亚洲午夜精品在线| 国模无码大尺度一区二区三区| 成人av资源站| 91麻豆精品91久久久久同性| 国产日韩av一区二区| 亚洲综合色婷婷| 国产精品一区二区在线观看不卡 | 亚洲精品国产一区二区精华液 | 日韩欧美国产麻豆| 国产精品久久久久久久久免费相片| 亚洲欧美日韩一区二区 | 国产 欧美在线| 在线观看视频欧美| 精品成人一区二区三区| 亚洲天堂精品视频| 激情综合色丁香一区二区| 91视视频在线观看入口直接观看www | 韩国午夜理伦三级不卡影院| 91在线云播放| 日韩精品中文字幕一区二区三区| 国产精品久久久久久久久动漫 | 欧美日韩国产乱码电影| 久久精品一区二区三区av| 亚洲成人自拍网| 成人精品电影在线观看| 欧美成人a视频| 亚洲与欧洲av电影| 成人免费视频视频在线观看免费| 欧美精品18+| 亚洲激情五月婷婷| 成人午夜激情在线| 欧美不卡一区二区三区| 亚洲午夜国产一区99re久久| 成人精品视频网站| 26uuu亚洲综合色| 视频一区欧美日韩| 91福利在线看| 国产精品美女久久久久aⅴ| 久久爱www久久做| 7777精品伊人久久久大香线蕉的 | 日精品一区二区三区| 97久久超碰精品国产| 国产午夜精品一区二区三区嫩草| 日本va欧美va瓶| 欧美区在线观看| 亚洲国产另类精品专区| 99re6这里只有精品视频在线观看| 久久丝袜美腿综合| 麻豆精品久久精品色综合| 欧美色图免费看| 一区二区成人在线视频| 色香色香欲天天天影视综合网| 中文欧美字幕免费| 丁香婷婷综合五月| 国产欧美综合色| 国产91精品一区二区麻豆网站| 日韩欧美国产高清| 久久精品72免费观看| 日韩一区二区三区免费看| 午夜精品一区二区三区三上悠亚| 欧洲在线/亚洲| 亚洲免费观看高清完整版在线观看 | 亚洲欧美一区二区三区国产精品| 国产成人av福利| 国产香蕉久久精品综合网| 国产精品77777| 欧美国产视频在线| www.爱久久.com| 成人欧美一区二区三区视频网页| av网站免费线看精品| 亚洲少妇中出一区| 欧美在线观看视频一区二区三区| 亚洲日本免费电影| 欧美系列在线观看| 婷婷开心激情综合| 制服.丝袜.亚洲.中文.综合| 日本vs亚洲vs韩国一区三区| 欧美xxxx老人做受| 国产福利一区二区三区视频 | 亚洲国产精品综合小说图片区| 欧美性大战久久久久久久蜜臀| 香蕉av福利精品导航 | 日韩二区三区在线观看| 欧美一区二区黄色| 国产精品自拍一区| 国产精品乱码人人做人人爱| 色婷婷综合久久久中文字幕| 亚洲一区影音先锋| 日韩欧美一级精品久久| 粉嫩在线一区二区三区视频| 亚洲欧美日韩一区| 91精品国产全国免费观看| 韩国三级在线一区| 亚洲色图.com| 91精品国产高清一区二区三区蜜臀 | 亚洲色图在线看| 欧美精品精品一区| 国产黄色精品网站| 亚洲精品久久7777| 日韩美女主播在线视频一区二区三区 | 日本亚洲欧美天堂免费| 久久久久久久综合色一本| 国产91综合一区在线观看| 曰韩精品一区二区| 日韩一区二区三区免费看| 不卡视频一二三| 日韩精品一二三区| 国产精品免费视频一区| 欧美日韩高清一区二区| 国产精品一区二区久久精品爱涩 | 国产成都精品91一区二区三| 亚洲国产一区在线观看| 26uuu亚洲综合色欧美| 色综合久久中文字幕| 九九精品一区二区| 亚洲一区二区三区中文字幕在线| 精品欧美一区二区三区精品久久| 99久久精品免费看国产| 蜜乳av一区二区三区| 悠悠色在线精品| 国产欧美一区二区精品忘忧草 | 夜夜揉揉日日人人青青一国产精品| 日韩欧美在线综合网| 91亚洲精品久久久蜜桃| 激情综合网激情| 天天色图综合网| 中文字幕一区二区三区精华液| 91精品国产欧美一区二区18| 91首页免费视频| 国产精品自拍在线| 热久久免费视频| 亚洲免费观看高清完整| 国产色91在线| 日韩一区二区三区在线| 欧美午夜精品理论片a级按摩| 国产aⅴ综合色| 另类调教123区| 偷窥少妇高潮呻吟av久久免费| 亚洲女人的天堂| 国产精品欧美一区喷水| 久久网这里都是精品| 日韩欧美中文字幕精品| 欧美美女直播网站| 91蜜桃视频在线| 从欧美一区二区三区| 国产乱码精品一区二区三| 天天综合色天天| 亚洲第一在线综合网站| 亚洲精品一卡二卡| 中文字幕一区视频| 日本一区二区不卡视频| 久久蜜桃av一区二区天堂| 日韩欧美国产电影| 91麻豆精品国产91久久久久久 | 欧美人与禽zozo性伦| 色网站国产精品| 99视频在线精品| 成人高清视频免费观看| 高清不卡一二三区| 国产成人夜色高潮福利影视| 国产精品一线二线三线|