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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? statementregressiontest.java

?? mysql jdbc驅(qū)動程序 mysql jdbc驅(qū)動程序 mysql jdbc驅(qū)動程序 mysql jdbc驅(qū)動程序
?? 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一区二区三区免费野_久草精品视频
欧美亚洲一区二区三区四区| 精品久久久久久久久久久院品网| 91麻豆精品视频| 日韩亚洲欧美在线| 亚洲乱码国产乱码精品精可以看 | 在线这里只有精品| 精品国产乱码久久久久久1区2区| 亚洲欧洲99久久| 国产成人亚洲综合a∨婷婷| 欧美日韩欧美一区二区| 亚洲欧洲成人精品av97| 国产曰批免费观看久久久| 欧美日韩国产高清一区二区| 中文字幕一区二区三区不卡在线| 精品一区二区三区在线观看国产| 欧美肥大bbwbbw高潮| 亚洲第一在线综合网站| 欧美性猛交xxxx乱大交退制版| 国产精品乱码一区二区三区软件 | 精品久久久久久最新网址| 亚洲三级免费电影| 国产成人av电影免费在线观看| 精品久久国产字幕高潮| 美腿丝袜亚洲三区| 91精品国产入口| 秋霞成人午夜伦在线观看| 51午夜精品国产| 天天影视涩香欲综合网| 欧美日韩日本视频| 日韩不卡一区二区| 日韩一区和二区| 久久国产福利国产秒拍| 精品国产电影一区二区| 国产精品99久久久久久久女警 | 亚洲综合一区二区| 欧美在线综合视频| 天堂在线一区二区| 日韩欧美一区二区三区在线| 久久66热偷产精品| 国产欧美一区二区精品久导航| 国产jizzjizz一区二区| 国产精品第一页第二页第三页| 91久色porny | 久久久久久97三级| 成人动漫一区二区三区| 伊人色综合久久天天| 欧美三级韩国三级日本一级| 青青草成人在线观看| 久久影院电视剧免费观看| 床上的激情91.| 一级做a爱片久久| 欧美日韩一卡二卡| 精品一区二区三区欧美| 国产精品白丝在线| 成人精品国产免费网站| 国产乱码精品一区二区三区忘忧草| 精彩视频一区二区| 国产精品热久久久久夜色精品三区| 91在线国内视频| 五月综合激情网| 国产视频一区不卡| 一本色道久久综合亚洲aⅴ蜜桃 | 日韩欧美色综合网站| 国产精品亚洲а∨天堂免在线| 亚洲欧美一区二区视频| 欧美日韩国产小视频| 国产成人激情av| 午夜激情久久久| 国产精品国产自产拍高清av王其| 欧美日韩一区二区三区视频| 国产精品2024| 丝袜亚洲另类丝袜在线| 国产精品网站在线观看| 日韩一区二区三区av| eeuss鲁片一区二区三区| 青青草精品视频| 亚洲另类中文字| 日本一区二区三区在线不卡| 欧美日韩黄色一区二区| av在线这里只有精品| 午夜国产精品一区| 国产精品黄色在线观看| 日韩色视频在线观看| 在线看国产一区二区| 国产精品69久久久久水密桃| 日本三级亚洲精品| 亚洲精品国产精华液| 中文字幕不卡在线| 精品国内二区三区| 精品视频1区2区3区| 91麻豆国产香蕉久久精品| 免费成人av资源网| 丝袜亚洲精品中文字幕一区| 一区二区三区精品久久久| 欧美国产一区在线| 久久免费精品国产久精品久久久久| 欧美日韩一级视频| 91激情在线视频| 91麻豆国产精品久久| 成人av在线电影| 久久99精品视频| 美国精品在线观看| 亚洲欧美日韩国产中文在线| 国产精品国模大尺度视频| 久久中文字幕电影| 日韩欧美激情四射| 欧美美女直播网站| 欧美最新大片在线看| 日本韩国欧美三级| 在线亚洲一区二区| 欧美艳星brazzers| 欧美亚洲动漫制服丝袜| 一本大道久久a久久综合| aaa国产一区| 在线观看一区不卡| 91成人在线观看喷潮| 91国内精品野花午夜精品| 91九色最新地址| 精品视频一区二区不卡| 欧美一区二区高清| 日韩精品一区二区三区四区视频| 欧美一区国产二区| 日韩一区二区电影在线| 精品粉嫩超白一线天av| 国产日韩欧美制服另类| 国产精品污污网站在线观看| 国产精品久久99| 亚洲乱码国产乱码精品精可以看| 亚洲一区在线视频| 日韩精品乱码免费| 精彩视频一区二区| 国产高清成人在线| 91在线观看一区二区| 欧美日韩一区国产| 日韩欧美亚洲另类制服综合在线| 精品乱人伦一区二区三区| 日本一区二区三区在线不卡| 亚洲视频每日更新| 首页欧美精品中文字幕| 精品亚洲成av人在线观看| 高清久久久久久| 欧美日韩精品欧美日韩精品| 精品美女在线播放| 国产精品理论片在线观看| 亚洲综合成人网| 国产乱码精品一区二区三区av| 成人av资源站| 777a∨成人精品桃花网| 欧美极品另类videosde| 亚洲国产视频在线| 粉嫩欧美一区二区三区高清影视| 色综合色狠狠天天综合色| 日韩一二三区不卡| 国产精品毛片久久久久久久| 午夜视频久久久久久| 国产成人av福利| 欧美日韩一区二区三区视频| 国产午夜精品久久久久久久| 亚洲女人的天堂| 激情图区综合网| 91久久人澡人人添人人爽欧美| 精品粉嫩aⅴ一区二区三区四区| 一色屋精品亚洲香蕉网站| 久久99久久久欧美国产| 日本电影亚洲天堂一区| 久久综合九色综合97_久久久| 亚洲精品欧美激情| 国产69精品久久久久毛片| 欧美精品一级二级| 亚洲日本在线视频观看| 国内精品自线一区二区三区视频| 欧美日韩电影一区| 日本一区二区在线不卡| 麻豆国产一区二区| 欧美亚洲精品一区| 亚洲乱码国产乱码精品精可以看| 国产综合久久久久久久久久久久 | 不卡的av中国片| 精品三级在线看| 日本不卡中文字幕| 91久久精品一区二区| 国产精品久久三区| 国产一区三区三区| 26uuu国产日韩综合| 日日夜夜精品视频免费| 欧美综合欧美视频| 成人欧美一区二区三区视频网页| 国产.精品.日韩.另类.中文.在线.播放| 欧美一区二区黄色| 日韩中文字幕91| 欧美理论在线播放| 香蕉加勒比综合久久| 欧美在线免费观看亚洲| 综合色天天鬼久久鬼色| 国产91精品欧美| 136国产福利精品导航| 成人av资源下载| 国产精品乱人伦中文| 成人精品国产免费网站| 最近中文字幕一区二区三区|