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

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

?? blobregressiontest.java

?? mysql jdbc驅動程序 mysql jdbc驅動程序 mysql jdbc驅動程序 mysql jdbc驅動程序
?? JAVA
字號:
/* 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 testsuite.regression;import java.io.ByteArrayInputStream;import java.io.File;import java.io.FileInputStream;import java.io.BufferedOutputStream;import java.io.FileOutputStream;import java.io.IOException;import java.io.StringReader;import java.sql.Blob;import java.sql.Connection;import java.sql.DriverManager;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.Statement;import java.util.Properties;import testsuite.BaseTestCase;/** * Tests fixes for BLOB handling. *  * @author Mark Matthews * @version $Id: BlobRegressionTest.java,v 1.1.2.19 2005/03/09 18:16:16 *          mmatthews Exp $ */public class BlobRegressionTest extends BaseTestCase {	/**	 * Creates a new BlobRegressionTest.	 * 	 * @param name	 *            name of the test to run	 */	public BlobRegressionTest(String name) {		super(name);	}	/**	 * Runs all test cases in this test suite	 * 	 * @param args	 */	public static void main(String[] args) {		junit.textui.TestRunner.run(BlobRegressionTest.class);	}	/**	 * 	 * 	 * @throws Exception	 *             ...	 */	public void testBug2670() throws Exception {		if (!isRunningOnJdk131()) {			try {				byte[] blobData = new byte[32];				for (int i = 0; i < blobData.length; i++) {					blobData[i] = 1;				}				this.stmt.executeUpdate("DROP TABLE IF EXISTS testBug2670");				this.stmt						.executeUpdate("CREATE TABLE testBug2670(blobField LONGBLOB)");				PreparedStatement pStmt = this.conn						.prepareStatement("INSERT INTO testBug2670 (blobField) VALUES (?)");				pStmt.setBytes(1, blobData);				pStmt.executeUpdate();				this.rs = this.stmt						.executeQuery("SELECT blobField FROM testBug2670");				this.rs.next();				Blob blob = this.rs.getBlob(1);				//				// Test mid-point insertion				//				blob.setBytes(4, new byte[] { 2, 2, 2, 2 });				byte[] newBlobData = blob.getBytes(1L, (int) blob.length());				assertTrue("Blob changed length",						blob.length() == blobData.length);				assertTrue(						"New data inserted wrongly",						((newBlobData[3] == 2) && (newBlobData[4] == 2)								&& (newBlobData[5] == 2) && (newBlobData[6] == 2)));				//				// Test end-point insertion				//				blob.setBytes(32, new byte[] { 2, 2, 2, 2 });				assertTrue("Blob length should be 3 larger",						blob.length() == (blobData.length + 3));			} finally {				this.stmt						.executeUpdate("DROP TABLE IF EXISTS testUpdateLongBlob");			}		}	}	/**	 * 	 * 	 * @throws Exception	 *             ...	 */	public void testUpdateLongBlobGT16M() throws Exception {		if (versionMeetsMinimum(4, 0)) {			try {				byte[] blobData = new byte[18 * 1024 * 1024]; // 18M blob				this.stmt						.executeUpdate("DROP TABLE IF EXISTS testUpdateLongBlob");				this.stmt						.executeUpdate("CREATE TABLE testUpdateLongBlob(blobField LONGBLOB)");				this.stmt						.executeUpdate("INSERT INTO testUpdateLongBlob (blobField) VALUES (NULL)");				PreparedStatement pStmt = this.conn						.prepareStatement("UPDATE testUpdateLongBlob SET blobField=?");				pStmt.setBytes(1, blobData);				pStmt.executeUpdate();			} finally {				this.stmt						.executeUpdate("DROP TABLE IF EXISTS testUpdateLongBlob");			}		}	}	/**	 * 	 * @throws Exception	 */	public void testUpdatableBlobsWithCharsets() throws Exception {		byte[] smallBlob = new byte[32];		for (byte i = 0; i < smallBlob.length; i++) {			smallBlob[i] = i;		}		try {			this.stmt					.executeUpdate("DROP TABLE IF EXISTS testUpdatableBlobsWithCharsets");			this.stmt					.executeUpdate("CREATE TABLE testUpdatableBlobsWithCharsets(pk INT NOT NULL PRIMARY KEY, field1 BLOB)");			PreparedStatement pStmt = this.conn					.prepareStatement("INSERT INTO testUpdatableBlobsWithCharsets (pk, field1) VALUES (1, ?)");			pStmt.setBinaryStream(1, new ByteArrayInputStream(smallBlob),					smallBlob.length);			pStmt.executeUpdate();			Statement updStmt = this.conn					.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,							ResultSet.CONCUR_UPDATABLE);			this.rs = updStmt					.executeQuery("SELECT pk, field1 FROM testUpdatableBlobsWithCharsets");			System.out.println(this.rs);			this.rs.next();			for (byte i = 0; i < smallBlob.length; i++) {				smallBlob[i] = (byte) (i + 32);			}			this.rs.updateBinaryStream(2, new ByteArrayInputStream(smallBlob),					smallBlob.length);			this.rs.updateRow();			ResultSet newRs = this.stmt					.executeQuery("SELECT field1 FROM testUpdatableBlobsWithCharsets");			newRs.next();			byte[] updatedBlob = newRs.getBytes(1);			for (byte i = 0; i < smallBlob.length; i++) {				byte origValue = smallBlob[i];				byte newValue = updatedBlob[i];				assertTrue("Original byte at position " + i + ", " + origValue						+ " != new value, " + newValue, origValue == newValue);			}		} finally {			this.stmt					.executeUpdate("DROP TABLE IF EXISTS testUpdatableBlobsWithCharsets");		}	}	public void testBug5490() throws Exception {		try {			this.stmt.executeUpdate("DROP TABLE IF EXISTS testBug5490");			this.stmt.executeUpdate("CREATE TABLE testBug5490"					+ "(pk INT NOT NULL PRIMARY KEY, blobField BLOB)");			String sql = "insert into testBug5490 values(?,?)";			int blobFileSize = 871;			File blobFile = newTempBinaryFile("Bug5490", blobFileSize);			PreparedStatement pStmt = this.conn.prepareStatement(sql,					ResultSet.TYPE_SCROLL_INSENSITIVE,					ResultSet.CONCUR_READ_ONLY);			pStmt.setInt(1, 2);			FileInputStream fis = new FileInputStream(blobFile);			pStmt.setBinaryStream(2, fis, blobFileSize);			pStmt.execute();			fis.close();			pStmt.close();			this.rs = this.stmt					.executeQuery("SELECT blobField FROM testBug5490");			this.rs.next();			byte[] returned = this.rs.getBytes(1);			assertEquals(blobFileSize, returned.length);		} finally {			this.stmt.executeUpdate("DROP TABLE IF EXISTS testBug5490");		}	}	/**	 * Tests BUG#8096 where emulated locators corrupt binary data when using	 * server-side prepared statements.	 * 	 * @throws Exception	 *             if the test fails.	 */	public void testBug8096() throws Exception {		if (!isRunningOnJdk131()) {			int dataSize = 256;			Properties props = new Properties();			props.setProperty("emulateLocators", "true");			Connection locatorConn = getConnectionWithProps(props);			String createTable = "CREATE TABLE testBug8096 (ID VARCHAR(10) "					+ "PRIMARY KEY, DATA LONGBLOB)";			String select = "SELECT ID, 'DATA' AS BLOB_DATA FROM testBug8096 "					+ "WHERE ID = ?";			String insert = "INSERT INTO testBug8096 (ID, DATA) VALUES (?, '')";			String id = "1";			byte[] testData = new byte[dataSize];			for (int i = 0; i < testData.length; i++) {				testData[i] = (byte) i;			}			try {				this.stmt.executeUpdate("DROP TABLE IF EXISTS testBug8096");				this.stmt.executeUpdate(createTable);				PreparedStatement ps = locatorConn.prepareStatement(insert);				ps.setString(1, id);				ps.execute();				ps = locatorConn.prepareStatement(select);				ps.setString(1, id);				this.rs = ps.executeQuery();				if (this.rs.next()) {					Blob b = rs.getBlob("BLOB_DATA");					b.setBytes(1, testData);				}				this.rs.close();				ps.close();				ps = locatorConn.prepareStatement(select);				ps.setString(1, id);				this.rs = ps.executeQuery();				byte[] result = null;				if (this.rs.next()) {					Blob b = this.rs.getBlob("BLOB_DATA");					result = b.getBytes(1, dataSize - 1);				}				this.rs.close();				ps.close();				assertNotNull(result);				for (int i = 0; i < result.length && i < testData.length; i++) {					// Will print out all of the values that don't match.					// All negative values will instead be replaced with 63.					if (result[i] != testData[i]) {						assertEquals("At position " + i, testData[i], result[i]);					}				}			} finally {				this.stmt.executeUpdate("DROP TABLE IF EXISTS testBug8096");			}		}	}	/**	 * Tests fix for BUG#9040 - PreparedStatement.addBatch() doesn't work with	 * server-side prepared statements and streaming BINARY data.	 * 	 * @throws Exception	 *             if the test fails.	 */	public void testBug9040() throws Exception {		try {			this.stmt.executeUpdate("DROP TABLE IF EXISTS testBug9040");			this.stmt.executeUpdate("create table if not exists testBug9040 "					+ "(primary_key int not null primary key, "					+ "data mediumblob)");			this.pstmt = this.conn					.prepareStatement("replace into testBug9040 (primary_key, data) values(?,?)");			int primaryKey = 1;			byte[] data = "First Row".getBytes();			this.pstmt.setInt(1, primaryKey);			this.pstmt.setBinaryStream(2, new ByteArrayInputStream(data),					data.length);			this.pstmt.addBatch();			primaryKey = 2;			data = "Second Row".getBytes();			this.pstmt.setInt(1, primaryKey);			this.pstmt.setBinaryStream(2, new ByteArrayInputStream(data),					data.length);			this.pstmt.addBatch();			this.pstmt.executeBatch();		} finally {			this.stmt.executeUpdate("DROP TABLE IF EXISTS testBug9040");			if (this.pstmt != null) {				this.pstmt.close();			}		}	}	public void testBug10850() throws Exception {		String tableName = "testBug10850";		createTable(tableName, "(field1 TEXT)");		PreparedStatement pStmt = null;		try {			pStmt = this.conn.prepareStatement("INSERT INTO " +			tableName + " VALUES (?)");			pStmt.setCharacterStream(1, new StringReader(""), 0);			pStmt.executeUpdate();			assertEquals("0", getSingleIndexedValueWithQuery(1,					"SELECT LENGTH(field1) FROM " + tableName).toString());			this.stmt.executeUpdate("TRUNCATE TABLE " + tableName);			pStmt.clearParameters();			pStmt.setBinaryStream(1, new ByteArrayInputStream(new byte[0]), 0);			pStmt.executeUpdate();			assertEquals("0", getSingleIndexedValueWithQuery(1,					"SELECT LENGTH(field1) FROM " + tableName).toString());			this.stmt.executeUpdate("TRUNCATE TABLE " + tableName);		} finally {			if (pStmt != null) {				pStmt.close();			}		}	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区四区在线播放 | 欧美国产禁国产网站cc| 欧美浪妇xxxx高跟鞋交| 91成人免费在线| 色综合久久中文字幕| 一本大道久久a久久精二百| 91老师片黄在线观看| www.欧美精品一二区| 91亚洲午夜精品久久久久久| 色天使久久综合网天天| 欧美三级在线视频| 91精品啪在线观看国产60岁| 日韩一级片网址| 久久综合久久99| 国产女人aaa级久久久级| 国产精品久久精品日日| 亚洲色图在线看| 性欧美疯狂xxxxbbbb| 强制捆绑调教一区二区| 裸体一区二区三区| 国产精品一二三在| 99久久精品免费看| 欧美日韩亚洲综合| 精品少妇一区二区三区在线播放| 久久麻豆一区二区| 亚洲美女一区二区三区| 午夜精品一区二区三区免费视频 | 在线观看国产一区二区| 欧美丰满美乳xxx高潮www| 欧美va日韩va| 亚洲欧美中日韩| 丝袜脚交一区二区| 国产精品香蕉一区二区三区| 91视频在线观看| 欧美一区二区网站| 国产欧美精品在线观看| 一区二区三区国产精品| 蜜臀av亚洲一区中文字幕| 成人免费视频视频在线观看免费| 色欧美片视频在线观看| 日韩女同互慰一区二区| 国产精品久久毛片av大全日韩| 亚洲国产中文字幕| 国产激情视频一区二区在线观看 | 欧美一级精品在线| 欧美国产一区二区| 偷拍自拍另类欧美| 国产成人亚洲综合a∨猫咪| 欧美亚洲一区三区| 国产日韩欧美一区二区三区综合| 亚洲专区一二三| 国产成人一级电影| 91超碰这里只有精品国产| 亚洲国产精品成人综合色在线婷婷| 亚洲成人在线免费| 国产凹凸在线观看一区二区 | 亚洲国产精品精华液网站| 韩国女主播一区二区三区| 欧美综合一区二区| 日本一区二区视频在线| 日韩制服丝袜av| 97超碰欧美中文字幕| 久久久久青草大香线综合精品| 亚洲在线一区二区三区| 高清成人免费视频| 日韩一级黄色片| 亚洲黄色av一区| 成人午夜又粗又硬又大| 欧美大白屁股肥臀xxxxxx| 亚洲男人的天堂在线观看| 国产精品一级二级三级| 日韩欧美精品在线视频| 亚洲一区二区欧美| 99re热视频精品| 久久久久久9999| 免费成人深夜小野草| 欧美日韩精品一区二区三区四区 | 高清shemale亚洲人妖| 日韩一级黄色片| 丝袜亚洲另类欧美| 欧美视频一区二区在线观看| 国产精品国产自产拍高清av| 国产乱码精品一品二品| 欧美videofree性高清杂交| 日韩福利电影在线| 欧美日韩美女一区二区| 一区二区三区不卡在线观看| fc2成人免费人成在线观看播放| 久久久久久亚洲综合| 精品在线观看免费| 欧美电影免费观看高清完整版| 香蕉乱码成人久久天堂爱免费| 色域天天综合网| 一区二区三区av电影| 色综合久久天天| 亚洲精品国产精品乱码不99| 91蜜桃网址入口| 亚洲欧美日韩综合aⅴ视频| 91丝袜国产在线播放| 亚洲色图在线看| 欧美中文字幕亚洲一区二区va在线 | 久久蜜桃一区二区| 国产精品性做久久久久久| 久久久国产精华| 国产99久久久国产精品潘金| 国产欧美日韩不卡| 成人午夜激情片| 国产麻豆视频一区二区| 欧美一区二区三区色| 丝袜诱惑亚洲看片| 91麻豆精品国产91久久久| 爽爽淫人综合网网站| 欧美疯狂性受xxxxx喷水图片| 天天色综合天天| 日韩欧美三级在线| 国产毛片精品视频| 国产精品狼人久久影院观看方式| 99综合电影在线视频| 亚洲免费观看高清完整版在线| 欧美日韩在线观看一区二区| 日韩**一区毛片| 久久亚区不卡日本| 成人丝袜高跟foot| 一区二区三区在线不卡| 欧美精品黑人性xxxx| 91一区二区在线观看| 一区二区三区精品在线| 91精品国产综合久久精品 | 高清在线成人网| 亚洲欧美日韩久久精品| 欧美日韩三级在线| 精品一区二区三区久久| 国产精品久久久久久久久动漫| 一本久久精品一区二区| 五月婷婷综合网| 久久精品夜色噜噜亚洲a∨| 99re亚洲国产精品| 免费xxxx性欧美18vr| 国产午夜亚洲精品理论片色戒| 9i看片成人免费高清| 日韩中文字幕一区二区三区| 国产日韩欧美精品一区| 欧美性色综合网| 国产一二精品视频| 一区二区三区中文字幕| 精品美女被调教视频大全网站| jizz一区二区| 久久精品免费看| 亚洲桃色在线一区| 精品国产乱码久久久久久免费| 激情都市一区二区| 国产欧美一区二区三区在线看蜜臀| 91美女在线观看| 韩国理伦片一区二区三区在线播放| 18欧美亚洲精品| 精品久久久久久久久久久久包黑料 | 精品一区二区三区在线观看| 自拍偷拍国产亚洲| 日韩欧美久久久| 91国在线观看| 国产精品一级黄| 青青草一区二区三区| 最新久久zyz资源站| 精品少妇一区二区三区视频免付费 | 欧美日本国产视频| 成人高清伦理免费影院在线观看| 日韩精品一级二级 | 丝袜亚洲另类丝袜在线| 国产精品成人一区二区三区夜夜夜| 欧美一级日韩免费不卡| 色综合天天综合在线视频| 国产一区91精品张津瑜| 首页综合国产亚洲丝袜| 一区二区三区在线播| 国产精品欧美一区喷水| 精品国产sm最大网站免费看| 欧美日韩免费电影| 91成人免费在线视频| 成人av动漫网站| 国产精品一区2区| 久久成人免费日本黄色| 午夜电影网一区| 亚洲老妇xxxxxx| 国产精品国产a| 国产嫩草影院久久久久| 欧美精品一区二区三区蜜桃| 日韩亚洲欧美高清| 欧美日韩亚洲不卡| 在线观看精品一区| 91色九色蝌蚪| 99国产一区二区三精品乱码| 日韩亚洲欧美高清| 欧美久久久久久久久久| 欧美在线色视频| 91久久精品一区二区三区| 99视频精品在线| 岛国一区二区在线观看| 国产mv日韩mv欧美| 国产成人在线视频播放| 狠狠色丁香久久婷婷综|