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

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

?? blobfromlocator.java

?? 用于JAVA數據庫連接.解壓就可用,方便得很
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* Copyright (C) 2002-2004 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.BufferedInputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.sql.SQLException;import java.util.ArrayList;import java.util.List;import com.mysql.jdbc.exceptions.NotYetImplementedException;/** * The representation (mapping) in the JavaTM programming language of an SQL * BLOB value. An SQL BLOB is a built-in type that stores a Binary Large Object * as a column value in a row of a database table. The driver implements Blob * using an SQL locator(BLOB), which means that a Blob object contains a logical * pointer to the SQL BLOB data rather than the data itself. A Blob object is * valid for the duration of the transaction in which is was created. Methods in * the interfaces ResultSet, CallableStatement, and PreparedStatement, such as * getBlob and setBlob allow a programmer to access an SQL BLOB value. The Blob * interface provides methods for getting the length of an SQL BLOB (Binary * Large Object) value, for materializing a BLOB value on the client, and for * determining the position of a pattern of bytes within a BLOB value. This * class is new in the JDBC 2.0 API. *  * @author Mark Matthews *  * @version $Id: BlobFromLocator.java,v 1.1.4.1 2005/05/19 18:31:49 mmatthews *          Exp $ */public class BlobFromLocator implements java.sql.Blob {	private List primaryKeyColumns = null;	private List primaryKeyValues = null;	/** The ResultSet that created this BLOB */	private ResultSetImpl creatorResultSet;	private String blobColumnName = null;	private String tableName = null;	private int numColsInResultSet = 0;	private int numPrimaryKeys = 0;	private String quotedId;	/**	 * Creates an updatable BLOB that can update in-place	 */	BlobFromLocator(ResultSetImpl creatorResultSetToSet, int blobColumnIndex)			throws SQLException {		this.creatorResultSet = creatorResultSetToSet;		this.numColsInResultSet = this.creatorResultSet.fields.length;		this.quotedId = this.creatorResultSet.connection.getMetaData()				.getIdentifierQuoteString();		if (this.numColsInResultSet > 1) {			this.primaryKeyColumns = new ArrayList();			this.primaryKeyValues = new ArrayList();			for (int i = 0; i < this.numColsInResultSet; i++) {				if (this.creatorResultSet.fields[i].isPrimaryKey()) {					StringBuffer keyName = new StringBuffer();					keyName.append(quotedId);					String originalColumnName = this.creatorResultSet.fields[i]							.getOriginalName();					if ((originalColumnName != null)							&& (originalColumnName.length() > 0)) {						keyName.append(originalColumnName);					} else {						keyName.append(this.creatorResultSet.fields[i]								.getName());					}					keyName.append(quotedId);					this.primaryKeyColumns.add(keyName.toString());					this.primaryKeyValues.add(this.creatorResultSet							.getString(i + 1));				}			}		} else {			notEnoughInformationInQuery();		}		this.numPrimaryKeys = this.primaryKeyColumns.size();		if (this.numPrimaryKeys == 0) {			notEnoughInformationInQuery();		}		if (this.creatorResultSet.fields[0].getOriginalTableName() != null) {			StringBuffer tableNameBuffer = new StringBuffer();			String databaseName = this.creatorResultSet.fields[0]					.getDatabaseName();			if ((databaseName != null) && (databaseName.length() > 0)) {				tableNameBuffer.append(quotedId);				tableNameBuffer.append(databaseName);				tableNameBuffer.append(quotedId);				tableNameBuffer.append('.');			}			tableNameBuffer.append(quotedId);			tableNameBuffer.append(this.creatorResultSet.fields[0]					.getOriginalTableName());			tableNameBuffer.append(quotedId);			this.tableName = tableNameBuffer.toString();		} else {			StringBuffer tableNameBuffer = new StringBuffer();			tableNameBuffer.append(quotedId);			tableNameBuffer.append(this.creatorResultSet.fields[0]					.getTableName());			tableNameBuffer.append(quotedId);			this.tableName = tableNameBuffer.toString();		}		this.blobColumnName = quotedId				+ this.creatorResultSet.getString(blobColumnIndex) + quotedId;	}	private void notEnoughInformationInQuery() throws SQLException {		throw SQLError.createSQLException("Emulated BLOB locators must come from "				+ "a ResultSet with only one table selected, and all primary "				+ "keys selected", SQLError.SQL_STATE_GENERAL_ERROR);	}	/**	 * @see Blob#setBinaryStream(long)	 */	public OutputStream setBinaryStream(long indexToWriteAt)			throws SQLException {		throw new NotImplemented();	}	/**	 * Retrieves the BLOB designated by this Blob instance as a stream.	 * 	 * @return this BLOB represented as a binary stream of bytes.	 * 	 * @throws SQLException	 *             if a database error occurs	 */	public java.io.InputStream getBinaryStream() throws SQLException {		// TODO: Make fetch size configurable		return new BufferedInputStream(new LocatorInputStream(),				this.creatorResultSet.connection.getLocatorFetchBufferSize());	}	/**	 * @see Blob#setBytes(long, byte[], int, int)	 */	public int setBytes(long writeAt, byte[] bytes, int offset, int length)			throws SQLException {		java.sql.PreparedStatement pStmt = null;		if ((offset + length) > bytes.length) {			length = bytes.length - offset;		}		byte[] bytesToWrite = new byte[length];		System.arraycopy(bytes, offset, bytesToWrite, 0, length);		// FIXME: Needs to use identifiers for column/table names		StringBuffer query = new StringBuffer("UPDATE ");		query.append(this.tableName);		query.append(" SET ");		query.append(this.blobColumnName);		query.append(" = INSERT(");		query.append(this.blobColumnName);		query.append(", ");		query.append(writeAt);		query.append(", ");		query.append(length);		query.append(", ?) WHERE ");		query.append((String) this.primaryKeyColumns.get(0));		query.append(" = ?");		for (int i = 1; i < this.numPrimaryKeys; i++) {			query.append(" AND ");			query.append((String) this.primaryKeyColumns.get(i));			query.append(" = ?");		}		try {			// FIXME: Have this passed in instead			pStmt = this.creatorResultSet.connection.prepareStatement(query					.toString());			pStmt.setBytes(1, bytesToWrite);			for (int i = 0; i < this.numPrimaryKeys; i++) {				pStmt.setString(i + 2, (String) this.primaryKeyValues.get(i));			}			int rowsUpdated = pStmt.executeUpdate();			if (rowsUpdated != 1) {				throw SQLError.createSQLException(						"BLOB data not found! Did primary keys change?",						SQLError.SQL_STATE_GENERAL_ERROR);			}		} finally {			if (pStmt != null) {				try {					pStmt.close();				} catch (SQLException sqlEx) {					; // do nothing				}				pStmt = null;			}		}		return (int) length();	}	/**	 * @see Blob#setBytes(long, byte[])	 */	public int setBytes(long writeAt, byte[] bytes) throws SQLException {		return setBytes(writeAt, bytes, 0, bytes.length);	}	/**	 * Returns as an array of bytes, part or all of the BLOB value that this	 * Blob object designates.	 * 	 * @param pos	 *            where to start the part of the BLOB	 * @param length	 *            the length of the part of the BLOB you want returned.	 * 	 * @return the bytes stored in the blob starting at position	 *         <code>pos</code> and having a length of <code>length</code>.	 * 	 * @throws SQLException	 *             if a database error occurs	 */	public byte[] getBytes(long pos, int length) throws SQLException {		java.sql.PreparedStatement pStmt = null;		try {			pStmt = createGetBytesStatement();			return getBytesInternal(pStmt, pos, length);		} finally {			if (pStmt != null) {				try {					pStmt.close();				} catch (SQLException sqlEx) {					; // do nothing				}				pStmt = null;			}		}	}		/**	 * Returns the number of bytes in the BLOB value designated by this Blob	 * object.	 * 	 * @return the length of this blob	 * 	 * @throws SQLException	 *             if a database error occurs	 */	public long length() throws SQLException {		java.sql.ResultSet blobRs = null;		java.sql.PreparedStatement pStmt = null;		// FIXME: Needs to use identifiers for column/table names		StringBuffer query = new StringBuffer("SELECT LENGTH(");		query.append(this.blobColumnName);		query.append(") FROM ");		query.append(this.tableName);		query.append(" WHERE ");		query.append((String) this.primaryKeyColumns.get(0));		query.append(" = ?");		for (int i = 1; i < this.numPrimaryKeys; i++) {			query.append(" AND ");			query.append((String) this.primaryKeyColumns.get(i));			query.append(" = ?");		}		try {			// FIXME: Have this passed in instead			pStmt = this.creatorResultSet.connection.prepareStatement(query					.toString());			for (int i = 0; i < this.numPrimaryKeys; i++) {				pStmt.setString(i + 1, (String) this.primaryKeyValues.get(i));			}			blobRs = pStmt.executeQuery();			if (blobRs.next()) {				return blobRs.getLong(1);			}			throw SQLError.createSQLException(					"BLOB data not found! Did primary keys change?",					SQLError.SQL_STATE_GENERAL_ERROR);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
1024精品合集| 自拍偷自拍亚洲精品播放| 日韩一区二区三区免费看| 精品久久久久一区二区国产| 国产午夜亚洲精品不卡| 亚洲一二三区在线观看| 日韩精品亚洲一区| 国产成人日日夜夜| 国产毛片精品视频| 色域天天综合网| 国产偷国产偷亚洲高清人白洁| 久久久综合激的五月天| www.在线成人| 欧洲日韩一区二区三区| 国产在线播放一区| www.亚洲激情.com| 国产精品三级在线观看| 国产午夜精品一区二区三区嫩草 | 国产精品乱码一区二三区小蝌蚪| 欧美三级视频在线| 一区二区三区中文免费| 欧美日韩专区在线| 午夜精品久久一牛影视| 91麻豆精品国产自产在线| 蜜桃视频免费观看一区| 国产精品久久久久影院老司| 中文字幕一区日韩精品欧美| 国产成人av一区二区三区在线 | 亚洲青青青在线视频| 成人av在线电影| 亚洲第一主播视频| 99久久久精品免费观看国产蜜| 2019国产精品| 狠狠色综合播放一区二区| 精品理论电影在线观看| 成人美女视频在线观看18| 欧美丰满美乳xxx高潮www| 国产一区亚洲一区| 首页国产欧美久久| 国产精品成人一区二区艾草| 欧美视频精品在线观看| 成人免费视频一区二区| 久久综合狠狠综合久久综合88| 国产三级一区二区三区| 国产精品欧美久久久久一区二区| 成人黄色电影在线| 粉嫩av亚洲一区二区图片| 国产精品国产三级国产a| 国产偷v国产偷v亚洲高清| 亚洲精品一区二区三区福利| 欧美中文字幕亚洲一区二区va在线 | 成人av电影免费在线播放| 欧美三级一区二区| 欧美日韩精品二区第二页| 在线视频国内自拍亚洲视频| 亚洲激情第一区| 欧美日本在线一区| 欧美日韩另类国产亚洲欧美一级| 国产成人丝袜美腿| 日韩在线a电影| 日韩欧美一区二区在线视频| 精品一区二区三区久久| 中文av一区二区| 一区二区在线观看视频| 国产欧美日韩另类视频免费观看| 成人动漫在线一区| 亚洲三级理论片| 夜夜嗨av一区二区三区中文字幕| 99久久精品99国产精品| 成人黄色软件下载| 欧美日韩在线直播| 亚洲国产精品黑人久久久| 国产午夜精品久久久久久久| 久久蜜桃av一区二区天堂| 蜜臀久久久99精品久久久久久| 国产一区二区三区高清播放| 欧美不卡视频一区| 精品国内片67194| 国产一区二区三区观看| 国产精品久久久久影院亚瑟 | 91麻豆swag| 亚洲成人av电影| 欧美日韩国产一级| 国内精品久久久久影院薰衣草 | 成人晚上爱看视频| 欧美成人性战久久| 成人sese在线| 午夜久久电影网| 欧美日韩视频一区二区| 日韩激情一二三区| 国产亚洲欧美日韩俺去了| 色老头久久综合| 一区二区三区日韩在线观看| 色综合一区二区| 99久久亚洲一区二区三区青草 | 欧美一区二区三区性视频| 日本一区中文字幕| 欧美韩国日本不卡| 亚洲欧美激情在线| 在线播放/欧美激情| 国产69精品久久久久毛片| 午夜在线电影亚洲一区| caoporen国产精品视频| 欧美视频一区二区三区| 日韩一级片网址| 亚洲欧洲av另类| 日本精品一区二区三区高清 | 91麻豆文化传媒在线观看| 17c精品麻豆一区二区免费| 欧美色图12p| 国产精品77777竹菊影视小说| 亚洲蜜臀av乱码久久精品| 日韩视频一区二区三区在线播放| 91丨九色丨尤物| 91丝袜美腿高跟国产极品老师| 国产一区不卡视频| 国产一区视频在线看| 日韩专区欧美专区| 国产日韩亚洲欧美综合| 国产精品五月天| 99国产欧美久久久精品| 国产一区久久久| 美女视频一区在线观看| 亚洲免费av在线| 精品福利一二区| 日韩丝袜情趣美女图片| 欧美午夜精品久久久久久孕妇| 欧美日韩国产免费一区二区 | 久久精品亚洲国产奇米99| 欧美日韩一区二区三区视频| 91久久精品日日躁夜夜躁欧美| 成人一区二区三区| 色综合咪咪久久| 99精品在线观看视频| 色香蕉成人二区免费| 99视频在线观看一区三区| 91网站在线观看视频| 99久久精品免费看| 色婷婷av一区二区三区软件| 91在线视频免费观看| 91亚洲精品乱码久久久久久蜜桃| 91久久一区二区| 午夜精品福利一区二区三区av | 99久久精品免费观看| 粉嫩aⅴ一区二区三区四区五区| 亚洲一级二级三级在线免费观看| 成人性色生活片| 国产精品素人一区二区| 91精品国产色综合久久| 8x8x8国产精品| 日韩亚洲欧美一区二区三区| 99视频一区二区三区| 欧美一区二区视频观看视频| 欧美亚洲国产一区在线观看网站| 欧美亚洲国产一区二区三区| 国产精品每日更新在线播放网址| 亚洲成人免费视| av中文字幕亚洲| 日韩精品中文字幕一区二区三区 | 国产日韩综合av| 中文字幕二三区不卡| 亚洲日本丝袜连裤袜办公室| 久久久精品免费观看| 亚洲成人免费视频| 九色综合国产一区二区三区| 91久久精品一区二区| 56国语精品自产拍在线观看| 国产精品免费视频网站| 一区二区三区日韩在线观看| 国产激情视频一区二区三区欧美| 99久久精品免费观看| 精品日韩欧美一区二区| 中文字幕一区二区三中文字幕| 天堂成人免费av电影一区| 久久精品噜噜噜成人av农村| 成人的网站免费观看| 欧美日韩一区二区在线观看| 久久久久久久久久久久久夜| 亚洲精品免费视频| 亚洲手机成人高清视频| 狠狠色伊人亚洲综合成人| 91亚洲午夜精品久久久久久| 精品欧美一区二区久久| 亚洲欧美另类图片小说| 青青草伊人久久| 91色综合久久久久婷婷| 欧美日本韩国一区| 日韩毛片一二三区| 久久99热狠狠色一区二区| 欧美夫妻性生活| 自拍偷拍国产精品| 成人动漫av在线| 日韩一区二区三| 日本午夜一本久久久综合| youjizz国产精品| 国产精品嫩草影院av蜜臀| 裸体在线国模精品偷拍| 欧美日韩中文字幕精品| 久久久久久久精| 久久激情五月激情|