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

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

?? statementregressiontest.java

?? 用于JAVA數據庫連接.解壓就可用,方便得很
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
/* Copyright (C) 2002-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 testsuite.regression;import java.io.ByteArrayInputStream;import java.io.ByteArrayOutputStream;import java.io.CharArrayReader;import java.io.File;import java.io.FileOutputStream;import java.io.FileWriter;import java.io.IOException;import java.io.PrintStream;import java.io.StringReader;import java.io.Writer;import java.math.BigDecimal;import java.math.BigInteger;import java.sql.BatchUpdateException;import java.sql.Blob;import java.sql.Clob;import java.sql.Connection;import java.sql.DataTruncation;import java.sql.Date;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.SQLWarning;import java.sql.Statement;import java.sql.Timestamp;import java.sql.Types;import java.util.Calendar;import java.util.Locale;import java.util.Properties;import java.util.TimeZone;import testsuite.BaseTestCase;import com.mysql.jdbc.SQLError;import com.mysql.jdbc.ServerPreparedStatement;import com.mysql.jdbc.exceptions.MySQLTimeoutException;/** * Regression tests for the Statement class *  * @author Mark Matthews */public class StatementRegressionTest extends BaseTestCase {	class PrepareThread extends Thread {		Connection c;		PrepareThread(Connection cn) {			this.c = cn;		}		public void run() {			for (int i = 0; i < 20; i++) // force this to end eventually			{				try {					this.c.prepareStatement("SELECT 1");					StatementRegressionTest.this.testServerPrepStmtDeadlockCounter++;					Thread.sleep(400);				} catch (SQLException sqlEx) {					throw new RuntimeException(sqlEx);				} catch (InterruptedException e) {					e.printStackTrace();				}			}		}	}	static int count = 0;	static int nextID = 1; // The next ID we expected to generate	/*	 * Each row in this table is to be converted into a single REPLACE	 * statement. If the value is zero, a new record is to be created using then	 * autoincrement feature. If the value is non-zero, the existing row of that	 * value is to be replace with, obviously, the same key. I expect one	 * Generated Key for each zero value - but I would accept one key for each	 * value, with non-zero values coming back as themselves.	 */	static final int[][] tests = { { 0 }, // generate 1			{ 1, 0, 0 }, // update 1, generate 2, 3			{ 2, 0, 0, }, // update 2, generate 3, 4	};	/**	 * Runs all test cases in this test suite	 * 	 * @param args	 */	public static void main(String[] args) {		junit.textui.TestRunner.run(StatementRegressionTest.class);	}	private int testServerPrepStmtDeadlockCounter = 0;	/**	 * Constructor for StatementRegressionTest.	 * 	 * @param name	 *            the name of the test to run	 */	public StatementRegressionTest(String name) {		super(name);	}	private void addBatchItems(Statement statement, PreparedStatement pStmt,			String tableName, int i) throws SQLException {		pStmt.setString(1, "ps_batch_" + i);		pStmt.setString(2, "ps_batch_" + i);		pStmt.addBatch();		statement.addBatch("INSERT INTO " + tableName				+ " (strdata1, strdata2) VALUES " + "(\"s_batch_" + i				+ "\",\"s_batch_" + i + "\")");	}	private void createGGKTables() throws Exception {		// Delete and recreate table		dropGGKTables();		this.stmt.executeUpdate("CREATE TABLE testggk ("				+ "id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,"				+ "val INT NOT NULL" + ")");	}	private void doGGKTestPreparedStatement(int[] values, boolean useUpdate)			throws Exception {		// Generate the the multiple replace command		StringBuffer cmd = new StringBuffer("REPLACE INTO testggk VALUES ");		int newKeys = 0;		for (int i = 0; i < values.length; i++) {			cmd.append("(");			if (values[i] == 0) {				cmd.append("NULL");				newKeys += 1;			} else {				cmd.append(values[i]);			}			cmd.append(", ");			cmd.append(count++);			cmd.append("), ");		}		cmd.setLength(cmd.length() - 2); // trim the final ", "		// execute and print it		System.out.println(cmd.toString());		PreparedStatement pStmt = this.conn.prepareStatement(cmd.toString(),				Statement.RETURN_GENERATED_KEYS);		if (useUpdate) {			pStmt.executeUpdate();		} else {			pStmt.execute();		}		// print out what actually happened		System.out.println("Expect " + newKeys				+ " generated keys, starting from " + nextID);		this.rs = pStmt.getGeneratedKeys();		StringBuffer res = new StringBuffer("Got keys");		int[] generatedKeys = new int[newKeys];		int i = 0;		while (this.rs.next()) {			if (i < generatedKeys.length) {				generatedKeys[i] = this.rs.getInt(1);			}			i++;			res.append(" " + this.rs.getInt(1));		}		int numberOfGeneratedKeys = i;		assertTrue(				"Didn't retrieve expected number of generated keys, expected "						+ newKeys + ", found " + numberOfGeneratedKeys,				numberOfGeneratedKeys == newKeys);		assertTrue("Keys didn't start with correct sequence: ",				generatedKeys[0] == nextID);		System.out.println(res.toString());		// Read and print the new state of the table		this.rs = this.stmt.executeQuery("SELECT id, val FROM testggk");		System.out.println("New table contents ");		while (this.rs.next())			System.out.println("Id " + this.rs.getString(1) + " val "					+ this.rs.getString(2));		// Tidy up		System.out.println("");		nextID += newKeys;	}	private void doGGKTestStatement(int[] values, boolean useUpdate)			throws Exception {		// Generate the the multiple replace command		StringBuffer cmd = new StringBuffer("REPLACE INTO testggk VALUES ");		int newKeys = 0;		for (int i = 0; i < values.length; i++) {			cmd.append("(");			if (values[i] == 0) {				cmd.append("NULL");				newKeys += 1;			} else {				cmd.append(values[i]);			}			cmd.append(", ");			cmd.append(count++);			cmd.append("), ");		}		cmd.setLength(cmd.length() - 2); // trim the final ", "		// execute and print it		System.out.println(cmd.toString());		if (useUpdate) {			this.stmt.executeUpdate(cmd.toString(),					Statement.RETURN_GENERATED_KEYS);		} else {			this.stmt.execute(cmd.toString(), Statement.RETURN_GENERATED_KEYS);		}		// print out what actually happened		System.out.println("Expect " + newKeys				+ " generated keys, starting from " + nextID);		this.rs = this.stmt.getGeneratedKeys();		StringBuffer res = new StringBuffer("Got keys");		int[] generatedKeys = new int[newKeys];		int i = 0;		while (this.rs.next()) {			if (i < generatedKeys.length) {				generatedKeys[i] = this.rs.getInt(1);			}			i++;			res.append(" " + this.rs.getInt(1));		}		int numberOfGeneratedKeys = i;		assertTrue(				"Didn't retrieve expected number of generated keys, expected "						+ newKeys + ", found " + numberOfGeneratedKeys,				numberOfGeneratedKeys == newKeys);		assertTrue("Keys didn't start with correct sequence: ",				generatedKeys[0] == nextID);		System.out.println(res.toString());		// Read and print the new state of the table		this.rs = this.stmt.executeQuery("SELECT id, val FROM testggk");		System.out.println("New table contents ");		while (this.rs.next())			System.out.println("Id " + this.rs.getString(1) + " val "					+ this.rs.getString(2));		// Tidy up		System.out.println("");		nextID += newKeys;	}	private void dropGGKTables() throws Exception {		this.stmt.executeUpdate("DROP TABLE IF EXISTS testggk");	}	/**	 * @param pStmt	 * @param catId	 * @throws SQLException	 */	private void execQueryBug5191(PreparedStatement pStmt, int catId)			throws SQLException {		pStmt.setInt(1, catId);		this.rs = pStmt.executeQuery();		assertTrue(this.rs.next());		assertTrue(this.rs.next());		// assertTrue(rs.next());		assertFalse(this.rs.next());	}	private String getByteArrayString(byte[] ba) {		StringBuffer buffer = new StringBuffer();		if (ba != null) {			for (int i = 0; i < ba.length; i++) {				buffer.append("0x" + Integer.toHexString(ba[i] & 0xff) + " ");			}		} else {			buffer.append("null");		}		return buffer.toString();	}	/**	 * @param continueBatchOnError	 * @throws SQLException	 */	private void innerBug6823(boolean continueBatchOnError) throws SQLException {		Properties continueBatchOnErrorProps = new Properties();		continueBatchOnErrorProps.setProperty("continueBatchOnError", String				.valueOf(continueBatchOnError));		this.conn = getConnectionWithProps(continueBatchOnErrorProps);		Statement statement = this.conn.createStatement();		String tableName = "testBug6823";		createTable(tableName, "(id int not null primary key auto_increment,"				+ " strdata1 varchar(255) not null, strdata2 varchar(255),"				+ " UNIQUE INDEX (strdata1))");		PreparedStatement pStmt = this.conn.prepareStatement("INSERT INTO "				+ tableName + " (strdata1, strdata2) VALUES (?,?)");		int c = 0;		addBatchItems(statement, pStmt, tableName, ++c);		addBatchItems(statement, pStmt, tableName, ++c);		addBatchItems(statement, pStmt, tableName, ++c);		addBatchItems(statement, pStmt, tableName, c); // duplicate entry		addBatchItems(statement, pStmt, tableName, ++c);		addBatchItems(statement, pStmt, tableName, ++c);		int expectedUpdateCounts = continueBatchOnError ? 6 : 3;		BatchUpdateException e1 = null;		BatchUpdateException e2 = null;		int[] updateCountsPstmt = null;		try {			updateCountsPstmt = pStmt.executeBatch();		} catch (BatchUpdateException e) {			e1 = e;			updateCountsPstmt = e1.getUpdateCounts();		}		int[] updateCountsStmt = null;		try {			updateCountsStmt = statement.executeBatch();		} catch (BatchUpdateException e) {			e2 = e;			updateCountsStmt = e1.getUpdateCounts();		}		assertNotNull(e1);		assertNotNull(e2);		assertEquals(expectedUpdateCounts, updateCountsPstmt.length);		assertEquals(expectedUpdateCounts, updateCountsStmt.length);		if (continueBatchOnError) {			assertTrue(updateCountsPstmt[3] == Statement.EXECUTE_FAILED);			assertTrue(updateCountsStmt[3] == Statement.EXECUTE_FAILED);		}		int psRows = 0;		this.rs = this.stmt.executeQuery("SELECT * from " + tableName				+ " WHERE strdata1 like \"ps_%\"");		while (this.rs.next()) {			psRows++;		}		assertTrue(psRows > 0);		int sRows = 0;		this.rs = this.stmt.executeQuery("SELECT * from " + tableName				+ " WHERE strdata1 like \"s_%\"");		while (this.rs.next()) {			sRows++;		}		assertTrue(sRows > 0);		assertTrue(psRows + "!=" + sRows, psRows == sRows);	}	/**	 * Tests fix for BUG#10155, double quotes not recognized when parsing	 * client-side prepared statements.	 * 	 * @throws Exception	 *             if the test fails.	 */	public void testBug10155() throws Exception {		this.conn.prepareStatement(				"SELECT \"Test question mark? Test single quote'\"")				.executeQuery().close();	}	/**	 * Tests fix for BUG#10630, Statement.getWarnings() fails with NPE if	 * statement has been closed.	 */	public void testBug10630() throws Exception {		Connection conn2 = null;		Statement stmt2 = null;		try {			conn2 = getConnectionWithProps((Properties)null);			stmt2 = conn2.createStatement();			conn2.close();			stmt2.getWarnings();			fail("Should've caught an exception here");		} catch (SQLException sqlEx) {			assertEquals("08003", sqlEx.getSQLState());		} finally {			if (stmt2 != null) {				stmt2.close();			}			if (conn2 != null) {				conn2.close();			}		}	}	/**	 * Tests fix for BUG#11115, Varbinary data corrupted when using server-side	 * prepared statements.	 */	public void testBug11115() throws Exception {		String tableName = "testBug11115";

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品三级av| 日韩一区二区免费在线观看| 亚洲黄色性网站| 亚洲欧洲综合另类在线| 国产精品成人一区二区艾草| 国产精品无遮挡| 中文字幕国产一区二区| 日韩欧美一区二区三区在线| 欧美天堂亚洲电影院在线播放| 91麻豆123| 日韩欧美国产wwwww| 国产嫩草影院久久久久| 一区二区视频在线| 精品一区二区三区日韩| 99精品偷自拍| 538prom精品视频线放| 91精品国产一区二区三区蜜臀| 91麻豆精品国产91久久久资源速度| 欧美裸体bbwbbwbbw| 3atv在线一区二区三区| 欧美肥妇bbw| 国产精品久久久久久久久免费桃花| 国产精品日日摸夜夜摸av| 亚洲人成影院在线观看| 亚洲精选视频免费看| 免费国产亚洲视频| 懂色中文一区二区在线播放| 91福利国产成人精品照片| 欧美日韩精品福利| 一区二区三区四区不卡视频 | 一区二区三区在线影院| 日韩精品欧美精品| 99免费精品视频| 精品88久久久久88久久久| 亚洲影院理伦片| 不卡免费追剧大全电视剧网站| 在线看不卡av| 国产蜜臀97一区二区三区| 欧美日韩一区二区三区免费看| 欧美韩日一区二区三区四区| 日韩在线卡一卡二| 在线一区二区三区四区五区 | 亚洲一卡二卡三卡四卡| 国产成人丝袜美腿| 欧美mv和日韩mv的网站| 亚洲伊人色欲综合网| 99国产精品久久久久久久久久| 欧美激情一区二区三区全黄| 国产一区在线观看麻豆| 欧美高清在线视频| 九色综合狠狠综合久久| 日本一二三四高清不卡| 国产成人99久久亚洲综合精品| 国产色一区二区| 成人激情免费网站| 中文字幕日本不卡| 欧美少妇一区二区| 久久99精品国产91久久来源| 26uuu精品一区二区| 99久久99久久精品免费看蜜桃| 亚洲激情第一区| 777午夜精品免费视频| 精品无人区卡一卡二卡三乱码免费卡| 精品国产一区二区在线观看| 经典三级一区二区| 国产精品伦一区| 欧美精品色综合| 成人av资源站| 久久成人免费网| 亚洲色图欧洲色图婷婷| 欧美mv日韩mv国产网站| 91官网在线免费观看| 蜜桃免费网站一区二区三区| 亚洲免费在线观看| 日韩三级伦理片妻子的秘密按摩| 成人午夜激情视频| 久久国产精品99久久久久久老狼 | 另类成人小视频在线| 久久久美女艺术照精彩视频福利播放| 91美女精品福利| 国产69精品一区二区亚洲孕妇| 天堂资源在线中文精品| 亚洲猫色日本管| 国产精品网友自拍| 久久综合色之久久综合| 日韩三级视频在线看| 欧美日韩激情在线| 欧美视频一区在线观看| 一本色道久久加勒比精品| 99在线精品免费| 国产精品 欧美精品| 国产在线观看一区二区 | 欧美在线一区二区三区| 色综合久久久久久久久久久| 国产精品一区在线| 粉嫩一区二区三区性色av| 狠狠狠色丁香婷婷综合激情| 国产精品99久久不卡二区| 国产另类ts人妖一区二区| 国产一区二区精品久久91| 高清成人在线观看| 成人在线一区二区三区| 免费国产亚洲视频| 99re成人精品视频| 欧美日韩一区二区三区四区五区| 91精品麻豆日日躁夜夜躁| 久久久久久免费毛片精品| 专区另类欧美日韩| 免费在线观看一区二区三区| 久久99国产精品久久| 成人在线视频一区| 欧美日韩另类国产亚洲欧美一级| 日韩欧美一区二区久久婷婷| 欧美激情一区在线观看| 亚洲精品视频在线看| 婷婷综合久久一区二区三区| 国产91精品精华液一区二区三区 | 精品国产三级电影在线观看| 国产精品二区一区二区aⅴ污介绍| 亚洲午夜视频在线观看| 国产成人h网站| 亚洲精品一区二区精华| 1000精品久久久久久久久| 五月天亚洲精品| 色综合久久久久综合体桃花网| 精品嫩草影院久久| 日韩av中文字幕一区二区三区| 9色porny自拍视频一区二区| 久久亚洲影视婷婷| 日本成人中文字幕| 884aa四虎影成人精品一区| 亚洲精品国产成人久久av盗摄 | 欧美丝袜第三区| 国产精品另类一区| 成熟亚洲日本毛茸茸凸凹| 欧美一区二区在线不卡| 日日骚欧美日韩| 欧美日韩视频在线一区二区| 亚洲综合视频在线| 欧美视频一区二区三区在线观看| 亚洲欧洲三级电影| 日本韩国欧美一区二区三区| 久久久久久99久久久精品网站| 亚洲狠狠丁香婷婷综合久久久| av一区二区三区四区| 亚洲欧美另类综合偷拍| 欧美日韩中文字幕精品| 久久成人羞羞网站| 国产精品色哟哟网站| 欧亚洲嫩模精品一区三区| 亚洲在线成人精品| 久久综合给合久久狠狠狠97色69| 精品一区二区三区免费观看| 久久日韩粉嫩一区二区三区| 国产在线精品免费| 亚洲制服丝袜一区| 国产午夜精品久久| 在线免费一区三区| 蜜臀久久99精品久久久久久9| 久久免费看少妇高潮| 欧美系列一区二区| 国产一区二区伦理| 午夜视频久久久久久| 欧美韩日一区二区三区| 91.成人天堂一区| 国产精品一区二区你懂的| 亚洲色图欧美偷拍| 国产日韩欧美亚洲| 91精品国产综合久久香蕉麻豆| 99麻豆久久久国产精品免费 | 成人丝袜视频网| 视频一区视频二区在线观看| 亚洲欧洲性图库| 欧美国产1区2区| 国产亚洲一本大道中文在线| 欧美一区二区美女| 欧美一区日韩一区| 精品少妇一区二区三区视频免付费 | 中文字幕一区日韩精品欧美| 日韩视频免费观看高清在线视频| jlzzjlzz亚洲女人18| 国产传媒欧美日韩成人| 久久精品99国产精品| 极品少妇xxxx精品少妇偷拍| 亚洲视频 欧洲视频| 中文字幕在线播放不卡一区| 欧美国产日韩亚洲一区| 亚洲国产精品精华液ab| 国产女主播一区| 亚洲欧美国产高清| 亚洲国产日韩一区二区| 日韩福利电影在线| 国产自产高清不卡| 91色九色蝌蚪| 欧美日韩卡一卡二| 日韩久久免费av| 中文字幕中文字幕在线一区| 国产精品不卡在线| 欧美96一区二区免费视频| 视频一区二区中文字幕|