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

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

?? statementregressiontest.java

?? 用于JAVA數(shù)據(jù)庫連接.解壓就可用,方便得很
?? 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";

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产一区在线观看| 日本欧美在线观看| 日韩视频免费观看高清在线视频| 国产精品一品二品| 亚洲伊人色欲综合网| xfplay精品久久| 在线看国产日韩| 国产成人免费视频精品含羞草妖精| 亚洲一二三专区| 中文字幕制服丝袜一区二区三区 | 成人性视频网站| 天天色图综合网| 亚洲欧洲综合另类在线| 久久蜜桃av一区二区天堂| 欧美日本在线观看| 在线精品国精品国产尤物884a| 国产成人午夜电影网| 日本午夜精品一区二区三区电影| 一区二区在线观看免费 | 中文字幕亚洲在| 久久综合网色—综合色88| 欧美片在线播放| 色哟哟国产精品| 9l国产精品久久久久麻豆| 国产中文字幕精品| 日本中文字幕一区二区有限公司| 亚洲影院免费观看| 中文字幕日韩一区二区| 日本一区二区三区视频视频| 精品国产伦一区二区三区免费 | 国产精品影视天天线| 日本女优在线视频一区二区| 亚洲观看高清完整版在线观看| 成人免费在线播放视频| 国产精品久久777777| 国产日韩影视精品| 久久久精品中文字幕麻豆发布| 日韩欧美第一区| 日韩欧美色综合| 精品国产一区二区三区忘忧草| 91精品欧美综合在线观看最新| 欧美精品日韩精品| 在线成人小视频| 91精品福利在线一区二区三区| 69成人精品免费视频| 欧美一区二区视频网站| 欧美一区二区国产| 欧美不卡一区二区三区| 久久女同精品一区二区| 国产蜜臀av在线一区二区三区 | 久久精品国产精品亚洲综合| 久久国产精品99久久久久久老狼| 久久福利视频一区二区| 黄色日韩三级电影| 成人精品视频一区二区三区| 97久久超碰精品国产| 色婷婷综合久久久中文一区二区| 欧美优质美女网站| 欧美高清视频不卡网| 精品国产一区二区三区av性色| 精品动漫一区二区三区在线观看| 久久伊人中文字幕| 中文字幕av一区二区三区高 | 国产午夜精品在线观看| 国产精品免费久久| 亚洲一区二区三区四区五区黄| 日韩影院免费视频| 国内精品免费**视频| 成人av网站在线| 欧美日韩视频专区在线播放| 日韩精品一区二区三区老鸭窝 | 亚洲精品一区在线观看| 国产女人18毛片水真多成人如厕| 亚洲裸体在线观看| 日本成人在线不卡视频| 成人午夜av在线| 欧美日韩免费在线视频| www久久久久| 亚洲精品免费电影| 九一久久久久久| 色哟哟亚洲精品| 日韩欧美国产电影| 亚洲色欲色欲www| 日本女人一区二区三区| 成人av在线网| 欧美一区二区黄色| 日韩美女视频一区| 久久99国产精品尤物| caoporn国产精品| 91精品国产综合久久国产大片| 国产网站一区二区| 三级不卡在线观看| www.成人在线| 日韩一区二区三区电影在线观看| 一区视频在线播放| 狠狠色丁香九九婷婷综合五月| 在线观看av一区| 国产日产亚洲精品系列| 日日摸夜夜添夜夜添精品视频| av电影一区二区| 亚洲精品一区二区在线观看| 亚洲成av人片一区二区梦乃| av不卡免费电影| 久久综合九色综合欧美亚洲| 亚洲成av人片| 色域天天综合网| 国产精品无人区| 国产一区二区三区四区五区美女| 欧美亚洲高清一区| 亚洲三级电影网站| 国产成人av福利| 欧美大片一区二区三区| 亚洲一区二区av电影| 99久久精品国产网站| 国产亚洲欧美日韩日本| 久久国产精品72免费观看| 欧美日韩高清影院| 一区二区在线观看免费| 99久久精品国产毛片| 国产欧美一二三区| 激情五月婷婷综合网| 日韩三级精品电影久久久| 婷婷成人激情在线网| 色94色欧美sute亚洲线路一久| 中文幕一区二区三区久久蜜桃| 国产在线一区二区综合免费视频| 欧美丰满嫩嫩电影| 天堂蜜桃91精品| 制服丝袜亚洲网站| 日韩一区欧美二区| 日韩一区二区影院| 免费在线成人网| 欧美电影免费提供在线观看| 美女爽到高潮91| 欧美成人猛片aaaaaaa| 麻豆91在线看| 337p粉嫩大胆色噜噜噜噜亚洲| 麻豆精品视频在线观看免费| 欧美zozozo| 国产福利一区二区| 中文字幕免费不卡| 972aa.com艺术欧美| 亚洲视频免费看| 欧洲视频一区二区| 午夜精品123| 欧美不卡激情三级在线观看| 国内精品伊人久久久久影院对白| 国产午夜亚洲精品理论片色戒| 国产91露脸合集magnet| 国产精品二区一区二区aⅴ污介绍| www.日韩精品| 亚洲一二三区视频在线观看| 欧美精品一级二级三级| 久久精品国产免费| 久久久www免费人成精品| 成人精品国产一区二区4080| 亚洲免费观看高清完整版在线观看| 日本精品视频一区二区| 天天综合天天做天天综合| 日韩欧美激情在线| 国产成人综合在线| 一区二区在线观看视频| 欧美一区二区三区四区在线观看| 精品亚洲成a人在线观看| 日本一区二区成人在线| 欧美中文字幕一二三区视频| 美女被吸乳得到大胸91| 中文字幕免费在线观看视频一区| 色播五月激情综合网| 日韩av不卡在线观看| 久久精品一区八戒影视| 色94色欧美sute亚洲线路二| 青青草伊人久久| 国产精品丝袜在线| 在线观看免费成人| 国内精品视频666| 亚洲精品一二三| 日韩欧美色综合| 91啪在线观看| 老司机免费视频一区二区三区| 国产精品美女久久久久av爽李琼 | 日韩影视精彩在线| 国产欧美日韩另类视频免费观看| 色婷婷激情一区二区三区| 免费成人在线播放| **网站欧美大片在线观看| 88在线观看91蜜桃国自产| 成人免费毛片嘿嘿连载视频| 三级影片在线观看欧美日韩一区二区| 久久久久久久一区| 欧美日韩精品一区二区三区蜜桃| 国产精品一区二区在线播放 | 欧美视频完全免费看| 国产福利精品一区二区| 天天综合天天做天天综合| 中文字幕一区二区三区蜜月| 欧美电影精品一区二区| 欧美视频在线不卡| 99精品视频在线免费观看| 久久99精品国产麻豆不卡|