亚洲欧美第一页_禁久久精品乱码_粉嫩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| 欧美一区二区播放| 国产精品久久久久久久久图文区| 午夜精品久久久久久久99樱桃| 国产suv精品一区二区883| 欧美亚男人的天堂| 日本一区二区成人| 久久99热这里只有精品| 欧美色综合影院| 一区二区三区四区蜜桃 | av福利精品导航| 精品久久久久久久久久久久久久久久久 | 欧美疯狂做受xxxx富婆| 中文字幕av一区二区三区高 | 亚洲第一二三四区| www.亚洲激情.com| 中文av一区二区| 精品在线一区二区| 欧美一区二区在线播放| 亚洲美女屁股眼交| av电影在线不卡| 亚洲欧洲av一区二区三区久久| 精品影院一区二区久久久| 欧美伦理影视网| 艳妇臀荡乳欲伦亚洲一区| 成人福利视频网站| 日本一区二区高清| 成人午夜免费电影| 欧美韩国日本综合| 成人av在线一区二区三区| 国产色产综合产在线视频| 韩国v欧美v亚洲v日本v| 久久综合久久久久88| 国产在线精品一区二区三区不卡| 日韩欧美自拍偷拍| 国内精品久久久久影院薰衣草 | 国产伦精一区二区三区| 欧美精品一区二区三区视频 | 天堂精品中文字幕在线| 欧美视频在线一区二区三区 | 日韩一级免费观看| 麻豆91精品视频| 国产亚洲欧洲997久久综合 | 青青草91视频| 久久综合av免费| 成人黄色大片在线观看| 亚洲精品菠萝久久久久久久| 欧美日韩一区国产| 久久精品国产澳门| 国产精品色在线| 欧美视频日韩视频| 国产在线视频一区二区三区| 欧美国产97人人爽人人喊| 在线亚洲欧美专区二区| 美腿丝袜亚洲综合| 国产精品素人视频| 欧美理论电影在线| 国产精品羞羞答答xxdd| 亚洲精品高清在线| 精品久久久久久久久久久久久久久 | 久久99久久久欧美国产| 国产日产欧美一区二区三区 | 精品国产三级电影在线观看| 暴力调教一区二区三区| 亚洲图片欧美视频| 久久久高清一区二区三区| 一本色道久久加勒比精品| 日本不卡123| 国产精品国产三级国产aⅴ入口| 欧美猛男gaygay网站| 韩国毛片一区二区三区| 欧美激情在线一区二区三区| 一区二区三区四区视频精品免费| 欧美人xxxx| 色婷婷久久久综合中文字幕| 精品在线播放免费| 亚洲最大成人网4388xx| 欧美精品一区二区三区蜜臀| 欧美中文字幕一二三区视频| 国产在线精品一区二区不卡了| 亚洲精品久久久蜜桃| 国产午夜一区二区三区| 欧美日韩国产精品成人| 不卡一区中文字幕| 精油按摩中文字幕久久| 亚洲成人av资源| 国产精品美女久久久久高潮| 555www色欧美视频| 色综合久久综合网欧美综合网| 国产精品综合久久| 美女视频第一区二区三区免费观看网站| 91小视频免费观看| 国产98色在线|日韩| 日韩二区三区四区| 亚洲一级二级在线| 亚洲天堂中文字幕| 国产精品免费人成网站| 久久综合色8888| 日韩午夜av一区| 在线播放/欧美激情| 91国产精品成人| 色综合久久久久久久久久久| 成人app在线观看| 床上的激情91.| 成人午夜在线播放| 大桥未久av一区二区三区中文| 国产在线精品不卡| 国产毛片精品视频| 国产·精品毛片| 丁香一区二区三区| 国产91富婆露脸刺激对白| 国产乱理伦片在线观看夜一区| 久久丁香综合五月国产三级网站| 久久精品国产亚洲一区二区三区| 蜜臀av亚洲一区中文字幕| 日本不卡免费在线视频| 麻豆精品一区二区av白丝在线| 男人的j进女人的j一区| 久久激情五月婷婷| 在线不卡欧美精品一区二区三区| 欧美在线观看视频一区二区三区| 91蝌蚪porny| 欧美无乱码久久久免费午夜一区 | 国产日韩精品一区二区三区在线| 精品国产区一区| 国产日产精品1区| 中文字幕二三区不卡| 最新久久zyz资源站| 亚洲六月丁香色婷婷综合久久| 亚洲乱码国产乱码精品精的特点 | 欧美日韩成人一区二区| 日韩一区二区视频| 国产亚洲欧美中文| 亚洲精品自拍动漫在线| 五月激情丁香一区二区三区| 日韩激情av在线| 国产高清久久久久| 色综合网站在线| 欧美高清视频不卡网| 久久综合九色综合97_久久久| 亚洲国产精品99久久久久久久久| 亚洲人成网站在线| 日日摸夜夜添夜夜添亚洲女人| 久久激情五月激情| 97aⅴ精品视频一二三区| 欧美日韩在线观看一区二区| 欧美成人一级视频| 一色屋精品亚洲香蕉网站| 亚洲图片有声小说| 国产精品系列在线观看| 在线一区二区视频| 久久夜色精品国产噜噜av| 亚洲精品成人在线| 国模大尺度一区二区三区| 色综合久久久久综合体桃花网| 91精品国产综合久久精品麻豆| 中文字幕免费在线观看视频一区| 亚洲电影你懂得| 福利电影一区二区| 欧美日本一区二区| 91视频在线看| 欧美精品乱码久久久久久| 日韩一二三区视频| 亚洲婷婷综合色高清在线| 久久99久久久久| 精品久久人人做人人爽| 中文字幕一区二区三区视频 | 久久99精品久久久久久| 97se亚洲国产综合自在线| 欧美电影免费观看高清完整版在线观看 | 一区二区三区色| 国产高清视频一区| 日韩欧美在线综合网| 亚洲嫩草精品久久| 成a人片国产精品| 2020国产精品久久精品美国| 日韩二区三区在线观看| 色噜噜狠狠成人网p站| 国产精品视频一二三| 精品亚洲porn| 欧美一级片在线看| 肉肉av福利一精品导航| 在线视频一区二区免费| 一区在线播放视频| 国产98色在线|日韩| 久久精品一区四区| 激情综合亚洲精品| 欧美不卡一区二区| 精品一区二区三区免费观看| 欧美伦理电影网| 亚洲国产va精品久久久不卡综合| 91麻豆swag| 中文字幕佐山爱一区二区免费| www.性欧美| 亚洲日本在线视频观看| 色综合视频在线观看| 国产精品久久久久aaaa| 成人av午夜电影| 中文字幕在线观看一区二区|