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

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

?? connectionregressiontest.java

?? mysql jdbc驅動程序 mysql jdbc驅動程序 mysql jdbc驅動程序 mysql jdbc驅動程序
?? 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.ByteArrayOutputStream;import java.io.PrintStream;import java.lang.reflect.Field;import java.lang.reflect.InvocationTargetException;import java.lang.reflect.Method;import java.sql.Connection;import java.sql.DriverManager;import java.sql.DriverPropertyInfo;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;import java.util.HashMap;import java.util.Iterator;import java.util.Locale;import java.util.Map;import java.util.Properties;import java.util.StringTokenizer;import testsuite.BaseTestCase;import com.mysql.jdbc.Driver;import com.mysql.jdbc.NonRegisteringDriver;import com.mysql.jdbc.ReplicationConnection;import com.mysql.jdbc.ReplicationDriver;import com.mysql.jdbc.log.StandardLogger;/** * Regression tests for Connections *  * @author Mark Matthews * @version $Id: ConnectionRegressionTest.java,v 1.1.2.1 2005/05/13 18:58:38 *          mmatthews Exp $ */public class ConnectionRegressionTest extends BaseTestCase {	/**	 * DOCUMENT ME!	 * 	 * @param name	 *            the name of the testcase	 */	public ConnectionRegressionTest(String name) {		super(name);	}	/**	 * Runs all test cases in this test suite	 * 	 * @param args	 */	public static void main(String[] args) {		junit.textui.TestRunner.run(ConnectionRegressionTest.class);	}	/**	 * DOCUMENT ME!	 * 	 * @throws Exception	 *             ...	 */	public void testBug1914() throws Exception {		System.out.println(this.conn				.nativeSQL("{fn convert(foo(a,b,c), BIGINT)}"));		System.out.println(this.conn				.nativeSQL("{fn convert(foo(a,b,c), BINARY)}"));		System.out				.println(this.conn.nativeSQL("{fn convert(foo(a,b,c), BIT)}"));		System.out.println(this.conn				.nativeSQL("{fn convert(foo(a,b,c), CHAR)}"));		System.out.println(this.conn				.nativeSQL("{fn convert(foo(a,b,c), DATE)}"));		System.out.println(this.conn				.nativeSQL("{fn convert(foo(a,b,c), DECIMAL)}"));		System.out.println(this.conn				.nativeSQL("{fn convert(foo(a,b,c), DOUBLE)}"));		System.out.println(this.conn				.nativeSQL("{fn convert(foo(a,b,c), FLOAT)}"));		System.out.println(this.conn				.nativeSQL("{fn convert(foo(a,b,c), INTEGER)}"));		System.out.println(this.conn				.nativeSQL("{fn convert(foo(a,b,c), LONGVARBINARY)}"));		System.out.println(this.conn				.nativeSQL("{fn convert(foo(a,b,c), LONGVARCHAR)}"));		System.out.println(this.conn				.nativeSQL("{fn convert(foo(a,b,c), TIME)}"));		System.out.println(this.conn				.nativeSQL("{fn convert(foo(a,b,c), TIMESTAMP)}"));		System.out.println(this.conn				.nativeSQL("{fn convert(foo(a,b,c), TINYINT)}"));		System.out.println(this.conn				.nativeSQL("{fn convert(foo(a,b,c), VARBINARY)}"));		System.out.println(this.conn				.nativeSQL("{fn convert(foo(a,b,c), VARCHAR)}"));	}	/**	 * Tests fix for BUG#3554 - Not specifying database in URL causes	 * MalformedURL exception.	 * 	 * @throws Exception	 *             if an error ocurrs.	 */	public void testBug3554() throws Exception {		try {			new NonRegisteringDriver().connect(					"jdbc:mysql://localhost:3306/?user=root&password=root",					new Properties());		} catch (SQLException sqlEx) {			assertTrue(sqlEx.getMessage().indexOf("Malformed") == -1);		}	}	/**	 * DOCUMENT ME!	 * 	 * @throws Exception	 *             ...	 */	public void testBug3790() throws Exception {		String field2OldValue = "foo";		String field2NewValue = "bar";		int field1OldValue = 1;		Connection conn1 = null;		Connection conn2 = null;		Statement stmt1 = null;		Statement stmt2 = null;		ResultSet rs2 = null;		Properties props = new Properties();		try {			this.stmt.executeUpdate("DROP TABLE IF EXISTS testBug3790");			this.stmt					.executeUpdate("CREATE TABLE testBug3790 (field1 INT NOT NULL PRIMARY KEY, field2 VARCHAR(32)) TYPE=InnoDB");			this.stmt.executeUpdate("INSERT INTO testBug3790 VALUES ("					+ field1OldValue + ", '" + field2OldValue + "')");			conn1 = getConnectionWithProps(props); // creates a new connection			conn2 = getConnectionWithProps(props); // creates another new			// connection			conn1.setAutoCommit(false);			conn2.setAutoCommit(false);			stmt1 = conn1.createStatement();			stmt1.executeUpdate("UPDATE testBug3790 SET field2 = '"					+ field2NewValue + "' WHERE field1=" + field1OldValue);			conn1.commit();			stmt2 = conn2.createStatement();			rs2 = stmt2.executeQuery("SELECT field1, field2 FROM testBug3790");			assertTrue(rs2.next());			assertTrue(rs2.getInt(1) == field1OldValue);			assertTrue(rs2.getString(2).equals(field2NewValue));		} finally {			this.stmt.executeUpdate("DROP TABLE IF EXISTS testBug3790");			if (rs2 != null) {				rs2.close();			}			if (stmt2 != null) {				stmt2.close();			}			if (stmt1 != null) {				stmt1.close();			}			if (conn1 != null) {				conn1.close();			}			if (conn2 != null) {				conn2.close();			}		}	}	/**	 * Tests if the driver configures character sets correctly for 4.1.x	 * servers. Requires that the 'admin connection' is configured, as this test	 * needs to create/drop databases.	 * 	 * @throws Exception	 *             if an error occurs	 */	public void testCollation41() throws Exception {		if (versionMeetsMinimum(4, 1) && isAdminConnectionConfigured()) {			Map charsetsAndCollations = getCharacterSetsAndCollations();			charsetsAndCollations.remove("latin7"); // Maps to multiple Java			// charsets			charsetsAndCollations.remove("ucs2"); // can't be used as a			// connection charset			Iterator charsets = charsetsAndCollations.keySet().iterator();			while (charsets.hasNext()) {				Connection charsetConn = null;				Statement charsetStmt = null;				try {					String charsetName = charsets.next().toString();					String collationName = charsetsAndCollations.get(							charsetName).toString();					Properties props = new Properties();					props.put("characterEncoding", charsetName);					System.out.println("Testing character set " + charsetName);					charsetConn = getAdminConnectionWithProps(props);					charsetStmt = charsetConn.createStatement();					charsetStmt							.executeUpdate("DROP DATABASE IF EXISTS testCollation41");					charsetStmt							.executeUpdate("DROP TABLE IF EXISTS testCollation41");					charsetStmt							.executeUpdate("CREATE DATABASE testCollation41 DEFAULT CHARACTER SET "									+ charsetName);					charsetConn.setCatalog("testCollation41");					// We've switched catalogs, so we need to recreate the					// statement to pick this up...					charsetStmt = charsetConn.createStatement();					StringBuffer createTableCommand = new StringBuffer(							"CREATE TABLE testCollation41"									+ "(field1 VARCHAR(255), field2 INT)");					charsetStmt.executeUpdate(createTableCommand.toString());					charsetStmt							.executeUpdate("INSERT INTO testCollation41 VALUES ('abc', 0)");					int updateCount = charsetStmt							.executeUpdate("UPDATE testCollation41 SET field2=1 WHERE field1='abc'");					assertTrue(updateCount == 1);				} finally {					if (charsetStmt != null) {						charsetStmt								.executeUpdate("DROP TABLE IF EXISTS testCollation41");						charsetStmt								.executeUpdate("DROP DATABASE IF EXISTS testCollation41");						charsetStmt.close();					}					if (charsetConn != null) {						charsetConn.close();					}				}			}		}	}	/**	 * Tests setReadOnly() being reset during failover	 * 	 * @throws Exception	 *             if an error occurs.	 */	public void testSetReadOnly() throws Exception {		Properties props = new Properties();		props.put("autoReconnect", "true");		String sepChar = "?";		if (BaseTestCase.dbUrl.indexOf("?") != -1) {			sepChar = "&";		}		Connection reconnectableConn = DriverManager.getConnection(				BaseTestCase.dbUrl + sepChar + "autoReconnect=true", props);		this.rs = reconnectableConn.createStatement().executeQuery(				"SELECT CONNECTION_ID()");		this.rs.next();		String connectionId = this.rs.getString(1);		reconnectableConn.setReadOnly(true);		boolean isReadOnly = reconnectableConn.isReadOnly();		Connection killConn = getConnectionWithProps((Properties)null);		killConn.createStatement().executeUpdate("KILL " + connectionId);		Thread.sleep(2000);		SQLException caughtException = null;		int numLoops = 8;		while (caughtException == null && numLoops > 0) {			numLoops--;			try {				reconnectableConn.createStatement().executeQuery("SELECT 1");			} catch (SQLException sqlEx) {				caughtException = sqlEx;			}		}		System.out				.println("Executing statement on reconnectable connection...");		this.rs = reconnectableConn.createStatement().executeQuery(				"SELECT CONNECTION_ID()");		this.rs.next();		assertTrue("Connection is not a reconnected-connection", !connectionId				.equals(this.rs.getString(1)));		try {			reconnectableConn.createStatement().executeQuery("SELECT 1");		} catch (SQLException sqlEx) {			; // ignore		}		reconnectableConn.createStatement().executeQuery("SELECT 1");		assertTrue(reconnectableConn.isReadOnly() == isReadOnly);	}	private Map getCharacterSetsAndCollations() throws Exception {		Map charsetsToLoad = new HashMap();		try {			this.rs = this.stmt.executeQuery("SHOW character set");			while (this.rs.next()) {				charsetsToLoad.put(this.rs.getString("Charset"), this.rs						.getString("Default collation"));			}			//			// These don't have mappings in Java...			//			charsetsToLoad.remove("swe7");			charsetsToLoad.remove("hp8");			charsetsToLoad.remove("dec8");			charsetsToLoad.remove("koi8u");			charsetsToLoad.remove("keybcs2");			charsetsToLoad.remove("geostd8");			charsetsToLoad.remove("armscii8");		} finally {			if (this.rs != null) {				this.rs.close();			}		}		return charsetsToLoad;	}	/**	 * Tests fix for BUG#4334, port #'s not being picked up for	 * failover/autoreconnect.	 * 	 * @throws Exception	 *             if an error occurs.	 */	public void testBug4334() throws Exception {		if (isAdminConnectionConfigured()) {			Connection adminConnection = null;			try {				adminConnection = getAdminConnection();				int bogusPortNumber = 65534;				NonRegisteringDriver driver = new NonRegisteringDriver();				Properties oldProps = driver.parseURL(BaseTestCase.dbUrl, null);				String host = driver.host(oldProps);				int port = driver.port(oldProps);				String database = oldProps						.getProperty(NonRegisteringDriver.DBNAME_PROPERTY_KEY);				String user = oldProps						.getProperty(NonRegisteringDriver.USER_PROPERTY_KEY);				String password = oldProps						.getProperty(NonRegisteringDriver.PASSWORD_PROPERTY_KEY);				StringBuffer newUrlToTestPortNum = new StringBuffer(						"jdbc:mysql://");				if (host != null) {					newUrlToTestPortNum.append(host);				}				newUrlToTestPortNum.append(":").append(port);				newUrlToTestPortNum.append(",");				if (host != null) {					newUrlToTestPortNum.append(host);				}				newUrlToTestPortNum.append(":").append(bogusPortNumber);				newUrlToTestPortNum.append("/");				if (database != null) {					newUrlToTestPortNum.append(database);				}				if ((user != null) || (password != null)) {					newUrlToTestPortNum.append("?");					if (user != null) {						newUrlToTestPortNum.append("user=").append(user);						if (password != null) {							newUrlToTestPortNum.append("&");						}					}					if (password != null) {						newUrlToTestPortNum.append("password=")								.append(password);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美美女网站色| 一区二区欧美在线观看| 国产精品麻豆网站| 日韩av午夜在线观看| eeuss影院一区二区三区| 欧美一级理论片| 亚洲色图在线播放| 国内欧美视频一区二区 | 91官网在线观看| 久久精品亚洲一区二区三区浴池| 亚洲国产精品视频| 91欧美一区二区| 国产亚洲成av人在线观看导航 | 国产一区二区视频在线| 欧美日韩国产首页| 亚洲男女一区二区三区| 成人综合在线观看| 国产视频一区二区在线| 久久精品国产成人一区二区三区| 欧美三片在线视频观看| 亚洲女与黑人做爰| 色域天天综合网| 亚洲欧洲三级电影| 国产精品1024久久| 国产人久久人人人人爽| 国产一区二区三区四区在线观看| 正在播放亚洲一区| 五月婷婷激情综合网| 欧洲视频一区二区| 亚洲午夜视频在线观看| 色哟哟国产精品免费观看| 成人欧美一区二区三区黑人麻豆| 丁香婷婷综合色啪| 中文字幕不卡的av| 波多野结衣视频一区| 国产女人18水真多18精品一级做 | 裸体健美xxxx欧美裸体表演| 91视视频在线直接观看在线看网页在线看| 国产色综合久久| 成人激情校园春色| 亚洲天堂中文字幕| 在线日韩一区二区| 日韩精品欧美成人高清一区二区| 欧美日韩电影在线播放| 天天色综合成人网| 精品成人佐山爱一区二区| 精品一二三四在线| 中文字幕精品综合| 色综合久久久网| 亚洲va天堂va国产va久| 777亚洲妇女| 国产精品自拍一区| 国产精品久久免费看| 91美女精品福利| 午夜视频在线观看一区二区三区 | 青青草97国产精品免费观看| 精品国产制服丝袜高跟| 成人精品高清在线| 亚洲成人动漫av| 26uuu久久综合| 色综合久久综合网97色综合| 亚洲成人动漫在线观看| 久久九九久久九九| 日韩欧美在线123| 国产精品一区二区在线看| 亚洲图片你懂的| 4438x亚洲最大成人网| 国产精品12区| 亚洲高清不卡在线| 欧美精品一区二区三区四区| 成人app下载| 三级成人在线视频| 亚洲国产精品黑人久久久| 欧美影视一区在线| 国产成人精品亚洲777人妖| 亚洲成人手机在线| 国产午夜一区二区三区| 欧美日韩精品一区二区在线播放| 国产一区二区在线观看免费| 尤物av一区二区| 久久久久久9999| 69av一区二区三区| 91浏览器入口在线观看| 精油按摩中文字幕久久| 亚洲精品伦理在线| 久久免费偷拍视频| 777久久久精品| 91美女片黄在线| 国产精品18久久久久久久网站| 亚洲最色的网站| 国产精品免费av| 久久一区二区视频| 91麻豆精品国产91久久久久| 97精品久久久久中文字幕| 激情文学综合插| 免费人成精品欧美精品| 一级中文字幕一区二区| 最近中文字幕一区二区三区| 久久久精品免费观看| 日韩免费视频一区二区| 欧美精品黑人性xxxx| 欧美亚洲禁片免费| 色爱区综合激月婷婷| 成人永久免费视频| 福利电影一区二区| 国产精品一区免费在线观看| 蜜臀国产一区二区三区在线播放 | 91老师国产黑色丝袜在线| 成人一级视频在线观看| 国产成人精品一区二区三区网站观看| 久久99深爱久久99精品| 激情综合色播激情啊| 久久99精品国产麻豆不卡| 男女男精品视频| 麻豆91免费观看| 国产老女人精品毛片久久| 久久国产乱子精品免费女| 日韩—二三区免费观看av| 免费观看在线色综合| 国产精品高潮呻吟久久| 欧美肥妇毛茸茸| 色哟哟一区二区| 欧美三级日韩三级国产三级| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 91网上在线视频| 在线免费亚洲电影| 欧美日韩一级视频| 欧美日韩1234| 欧美一级夜夜爽| 精品国产在天天线2019| 精品第一国产综合精品aⅴ| 久久久天堂av| 中文字幕在线不卡| 亚洲一级片在线观看| 亚洲成人777| 激情综合色丁香一区二区| 国产激情视频一区二区在线观看 | 成人不卡免费av| 91黄色激情网站| 欧美精选午夜久久久乱码6080| 在线电影院国产精品| 日韩欧美卡一卡二| 国产精品视频你懂的| 亚洲品质自拍视频网站| 亚洲电影你懂得| 久久黄色级2电影| 97精品电影院| 日韩视频一区二区三区在线播放 | 国产成人精品午夜视频免费| 91国偷自产一区二区使用方法| 欧美一级生活片| 中文字幕不卡一区| 亚洲一区二区三区中文字幕| 久久精品二区亚洲w码| 成人免费av网站| 欧美美女一区二区三区| 久久久精品国产免费观看同学| 亚洲乱码国产乱码精品精98午夜| 婷婷丁香久久五月婷婷| 国产福利一区二区三区在线视频| 日本韩国一区二区三区| 欧美α欧美αv大片| 中文字幕在线观看一区| 秋霞电影网一区二区| 成人性生交大合| 欧美一区二区在线免费观看| 久久精品日产第一区二区三区高清版 | 亚洲色图视频网站| 蜜臀av在线播放一区二区三区| 99久久综合99久久综合网站| 国产精品欧美久久久久无广告 | 欧美成人a∨高清免费观看| 亚洲视频一区二区免费在线观看| 美女视频第一区二区三区免费观看网站 | 久久国产精品第一页| 91福利国产成人精品照片| 久久精品亚洲国产奇米99| 亚洲18色成人| 91在线视频观看| 国产精品五月天| 激情国产一区二区 | 色伊人久久综合中文字幕| 国产日韩欧美精品电影三级在线| 青青草成人在线观看| 欧美在线free| 成人免费一区二区三区视频| 丰满亚洲少妇av| 久久蜜桃一区二区| 久久国产尿小便嘘嘘尿| 欧美一级在线观看| 奇米色一区二区| 日韩一区二区电影网| 午夜精品123| 欧美日韩成人一区二区| 亚洲一区二区三区激情| 91久久精品日日躁夜夜躁欧美| 亚洲欧美综合色| 95精品视频在线| 亚洲男人天堂一区| 色婷婷av一区二区三区大白胸|