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

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

?? blobtest.java

?? 用于JAVA數據庫連接.解壓就可用,方便得很
?? 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.simple;import testsuite.BaseTestCase;import java.io.BufferedInputStream;import java.io.BufferedOutputStream;import java.io.ByteArrayOutputStream;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.InputStream;import java.sql.Connection;import java.sql.SQLException;/** * Tests BLOB functionality in the driver. *  * @author Mark Matthews * @version $Id: BlobTest.java 6437 2007-05-24 20:17:01Z mmatthews $ */public class BlobTest extends BaseTestCase {	private static File testBlobFile;	static {		Runtime.getRuntime().addShutdownHook(new Thread() {			public void run() {				for (int i = 0; i < 5; i++) {					try {						if (testBlobFile.delete()) {							break;						}					} catch (Throwable t) {					}				}			}		});	}	/**	 * Creates a new BlobTest object.	 * 	 * @param name	 *            the test to run	 */	public BlobTest(String name) {		super(name);	}	/**	 * Runs all test cases in this test suite	 * 	 * @param args	 */	public static void main(String[] args) {		junit.textui.TestRunner.run(BlobTest.class);	}	/**	 * Setup the test case	 * 	 * @throws Exception	 *             if an error occurs	 */	public void setUp() throws Exception {		super.setUp();		if (versionMeetsMinimum(4, 0)) {			int requiredSize = 32 * 1024 * 1024;			if (testBlobFile == null || testBlobFile.length() != requiredSize) {				createBlobFile(requiredSize);			}		} else {			int requiredSize = 8 * 1024 * 1024;			if (testBlobFile == null || testBlobFile.length() != requiredSize) {				createBlobFile(requiredSize);			}		}		createTestTable();	}	/**	 * Destroy resources created by test case	 * 	 * @throws Exception	 *             if an error occurs	 */	public void tearDown() throws Exception {		try {			this.stmt.executeUpdate("DROP TABLE IF EXISTS BLOBTEST");		} catch (Exception e) {			e.printStackTrace();		} finally {			super.tearDown();		}	}	public void testByteStreamInsert() throws Exception {		testByteStreamInsert(this.conn);	}	/**	 * Tests inserting blob data as a stream	 * 	 * @throws Exception	 *             if an error occurs	 */	private void testByteStreamInsert(Connection c) throws Exception {		BufferedInputStream bIn = new BufferedInputStream(new FileInputStream(				testBlobFile));		this.pstmt = c				.prepareStatement("INSERT INTO BLOBTEST(blobdata) VALUES (?)");		this.pstmt.setBinaryStream(1, bIn, (int) testBlobFile.length());		this.pstmt.execute();		this.pstmt.clearParameters();		doRetrieval();	}	private boolean checkBlob(byte[] retrBytes) throws Exception {		boolean passed = false;		BufferedInputStream bIn = new BufferedInputStream(new FileInputStream(				testBlobFile));		try {			int fileLength = (int) testBlobFile.length();			if (retrBytes.length == fileLength) {				for (int i = 0; i < fileLength; i++) {					byte fromFile = (byte) (bIn.read() & 0xff);					if (retrBytes[i] != fromFile) {						passed = false;						System.out.println("Byte pattern differed at position "								+ i + " , " + retrBytes[i] + " != " + fromFile);						for (int j = 0; (j < (i + 10)) /* && (j < i) */; j++) {							System.out.print(Integer									.toHexString(retrBytes[j] & 0xff)									+ " ");						}						break;					}					passed = true;				}			} else {				passed = false;				System.out.println("retrBytes.length(" + retrBytes.length						+ ") != testBlob.length(" + fileLength + ")");			}			return passed;		} finally {			if (bIn != null) {				bIn.close();			}		}	}	private void createTestTable() throws Exception {		//		// Catch the error, the table might exist		//		try {			this.stmt.executeUpdate("DROP TABLE BLOBTEST");		} catch (SQLException SQLE) {			;		}		this.stmt				.executeUpdate("CREATE TABLE BLOBTEST (pos int PRIMARY KEY auto_increment, "						+ "blobdata LONGBLOB)");	}	/**	 * Mark this as deprecated to avoid warnings from compiler...	 * 	 * @deprecated	 * 	 * @throws Exception	 *             if an error occurs retrieving the value	 */	private void doRetrieval() throws Exception {		boolean passed = false;		this.rs = this.stmt				.executeQuery("SELECT blobdata from BLOBTEST LIMIT 1");		this.rs.next();		byte[] retrBytes = this.rs.getBytes(1);		passed = checkBlob(retrBytes);		assertTrue(				"Inserted BLOB data did not match retrieved BLOB data for getBytes().",				passed);		retrBytes = this.rs.getBlob(1).getBytes(1L,				(int) this.rs.getBlob(1).length());		passed = checkBlob(retrBytes);		assertTrue(				"Inserted BLOB data did not match retrieved BLOB data for getBlob().",				passed);		InputStream inStr = this.rs.getBinaryStream(1);		ByteArrayOutputStream bOut = new ByteArrayOutputStream();		int b;		while ((b = inStr.read()) != -1) {			bOut.write((byte) b);		}		retrBytes = bOut.toByteArray();		passed = checkBlob(retrBytes);		assertTrue(				"Inserted BLOB data did not match retrieved BLOB data for getBinaryStream().",				passed);		inStr = this.rs.getAsciiStream(1);		bOut = new ByteArrayOutputStream();		while ((b = inStr.read()) != -1) {			bOut.write((byte) b);		}		retrBytes = bOut.toByteArray();		passed = checkBlob(retrBytes);		assertTrue(				"Inserted BLOB data did not match retrieved BLOB data for getAsciiStream().",				passed);		inStr = this.rs.getUnicodeStream(1);		bOut = new ByteArrayOutputStream();		while ((b = inStr.read()) != -1) {			bOut.write((byte) b);		}		retrBytes = bOut.toByteArray();		passed = checkBlob(retrBytes);		assertTrue(				"Inserted BLOB data did not match retrieved BLOB data for getUnicodeStream().",				passed);	}	private final static String TEST_BLOB_FILE_PREFIX = "cmj-testblob";		private void createBlobFile(int size) throws Exception {		if (testBlobFile != null && testBlobFile.length() != size) {			testBlobFile.delete();		}		testBlobFile = File.createTempFile(TEST_BLOB_FILE_PREFIX, ".dat");		testBlobFile.deleteOnExit();				cleanupTempFiles(testBlobFile, TEST_BLOB_FILE_PREFIX);		BufferedOutputStream bOut = new BufferedOutputStream(				new FileOutputStream(testBlobFile));		int dataRange = Byte.MAX_VALUE - Byte.MIN_VALUE;		for (int i = 0; i < size; i++) {			bOut.write((byte) ((Math.random() * dataRange) + Byte.MIN_VALUE));		}		bOut.flush();		bOut.close();	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲日本一区二区| 最新不卡av在线| 自拍偷拍亚洲激情| 蜜臀精品一区二区三区在线观看 | 欧美日韩精品专区| 成人av片在线观看| 国产jizzjizz一区二区| 在线观看一区日韩| 欧美国产日本韩| 久久精品国产在热久久| 欧美日韩精品三区| 亚洲精品一卡二卡| 91尤物视频在线观看| 久久久99久久| 久久精品国产99国产| 欧美天天综合网| 亚洲码国产岛国毛片在线| 成人午夜视频网站| 中文字幕精品三区| 国产成人免费在线观看不卡| 色呦呦国产精品| 亚洲三级在线免费| 久久九九久精品国产免费直播| 日韩成人精品视频| 亚洲精品视频一区二区| 日韩精品三区四区| 欧美丝袜丝nylons| 一区二区三区视频在线观看| aaa亚洲精品| 最新国产精品久久精品| 99视频在线观看一区三区| 国产精品久久久久久久久果冻传媒 | 91麻豆免费视频| 亚洲特级片在线| 91丨九色丨蝌蚪富婆spa| 国产精品不卡视频| 欧日韩精品视频| 亚洲第一搞黄网站| 欧美一级电影网站| 国产在线不卡一区| 中文字幕精品综合| 欧美在线观看一区| 麻豆精品精品国产自在97香蕉| 日韩免费在线观看| 懂色av一区二区在线播放| 国产精品视频一二三区 | 中文字幕在线不卡国产视频| 99在线精品观看| 亚洲一区二区三区四区在线观看 | 日韩欧美在线一区二区三区| 欧美精品久久一区| 日本特黄久久久高潮| 91精品国产品国语在线不卡| 婷婷夜色潮精品综合在线| 日韩精品一区二区三区视频播放| 国产美女一区二区三区| 中文字幕一区二区5566日韩| 欧洲视频一区二区| 捆绑调教一区二区三区| 中文字幕成人在线观看| 欧美日韩一区二区电影| 国产精品1024| 亚洲国产精品一区二区久久恐怖片| 色婷婷精品大在线视频| 伦理电影国产精品| 亚洲欧美区自拍先锋| 精品欧美一区二区在线观看| 99精品欧美一区二区三区小说 | 99麻豆久久久国产精品免费 | 日本aⅴ免费视频一区二区三区| 精品国产乱码久久久久久久| 成人av动漫网站| 亚洲mv在线观看| 国产欧美一区二区精品忘忧草 | 日本亚洲最大的色成网站www| 精品国产乱码久久久久久1区2区| 99久久精品国产导航| 免费成人在线视频观看| 亚洲欧美激情一区二区| 久久影视一区二区| 在线不卡一区二区| 色狠狠综合天天综合综合| 国产一区二区免费视频| 亚洲sss视频在线视频| 中文字幕一区二区视频| 国产亚洲午夜高清国产拍精品 | 国产拍揄自揄精品视频麻豆| 欧美日韩三级一区二区| 99久精品国产| 丰满少妇久久久久久久| 精品写真视频在线观看| 亚洲第一电影网| 亚洲精品乱码久久久久久久久 | 中文久久乱码一区二区| 精品久久久久久久一区二区蜜臀| 欧美三级视频在线| 91免费观看国产| 国产一区福利在线| 麻豆精品久久精品色综合| 亚洲国产精品人人做人人爽| 国产精品久久久久久久久果冻传媒| 精品国产一区二区亚洲人成毛片| 欧美日韩中文字幕一区二区| 91免费小视频| 色诱亚洲精品久久久久久| 成人黄色国产精品网站大全在线免费观看| 紧缚捆绑精品一区二区| 精品一区二区三区在线观看| 久久se精品一区精品二区| 免费欧美日韩国产三级电影| 五月婷婷综合激情| 三级欧美在线一区| 午夜电影网一区| 热久久免费视频| 国内精品久久久久影院色| 日本不卡高清视频| 午夜久久久影院| 免费高清不卡av| 狠狠色伊人亚洲综合成人| 国产精品91一区二区| 国产成人免费视频网站| 国产成人亚洲精品青草天美| 成人综合日日夜夜| 91亚洲国产成人精品一区二区三 | 久久青草欧美一区二区三区| 久久久久国产精品免费免费搜索| 久久久午夜精品| 国产精品第四页| 亚洲午夜免费福利视频| 日韩av成人高清| 韩国av一区二区三区在线观看| 国产精一区二区三区| 99久久婷婷国产综合精品| 91一区在线观看| 欧美妇女性影城| 欧美mv和日韩mv的网站| 中文字幕+乱码+中文字幕一区| 国产精品久久久久久久久久久免费看| 成人欧美一区二区三区视频网页| 亚洲综合丁香婷婷六月香| 日韩av在线发布| 国产69精品久久久久777| 色综合久久88色综合天天6| 777色狠狠一区二区三区| 国产亚洲欧美日韩在线一区| 亚洲欧洲成人精品av97| 亚洲bt欧美bt精品| 国产精品亚洲一区二区三区妖精 | 欧美亚洲一区二区在线观看| 日韩一级黄色片| 亚洲男同性视频| 久久99精品网久久| 91视视频在线直接观看在线看网页在线看| 欧美日韩视频专区在线播放| 国产亲近乱来精品视频| 亚洲一区二区三区四区的| 久久99久国产精品黄毛片色诱| 国产sm精品调教视频网站| 6080日韩午夜伦伦午夜伦| 中文字幕在线播放不卡一区| 久久精品久久综合| 在线中文字幕不卡| 国产日韩欧美高清| 日韩vs国产vs欧美| 国产99精品国产| www.在线欧美| 99精品视频在线播放观看| 日韩一区二区三区电影在线观看| 亚洲丝袜自拍清纯另类| 精品在线观看视频| 欧美日本在线播放| 亚洲免费色视频| 成人黄色一级视频| 欧美r级电影在线观看| 香蕉久久夜色精品国产使用方法 | 国产麻豆日韩欧美久久| 欧美日韩国产综合一区二区| 国产日产欧产精品推荐色| 日本系列欧美系列| 欧美性猛交xxxxxxxx| 中文字幕在线观看一区二区| 国产一区二区看久久| 日韩欧美综合一区| 日韩高清欧美激情| 欧美日韩免费观看一区二区三区| 亚洲欧美一区二区在线观看| 国产麻豆一精品一av一免费 | 麻豆国产精品官网| 91麻豆精品国产91久久久更新时间| 亚洲精品视频在线观看免费| 成人av在线影院| 国产精品沙发午睡系列990531| 狠狠色丁香久久婷婷综合_中| 91精品国产丝袜白色高跟鞋| 三级精品在线观看| 3d动漫精品啪啪一区二区竹菊| 亚洲一区二区三区影院| 欧美午夜理伦三级在线观看| 亚洲午夜国产一区99re久久| 91精品1区2区|