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

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

?? connectionregressiontest.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.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.ConnectionImpl;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);					}				}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美另类久久久品| 亚洲成人精品一区二区| 美腿丝袜在线亚洲一区| 欧美亚日韩国产aⅴ精品中极品| 26uuuu精品一区二区| 经典三级在线一区| 久久久不卡网国产精品一区| 激情丁香综合五月| 久久午夜免费电影| 成人网在线播放| 久久欧美中文字幕| 国产高清不卡一区二区| 日本一区二区三区四区| 成人精品免费网站| 亚洲精品五月天| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 中文字幕中文字幕在线一区| 91在线无精精品入口| 亚洲人123区| 日韩欧美中文字幕公布| 日本系列欧美系列| 国产女主播视频一区二区| 99re热视频精品| 日韩不卡在线观看日韩不卡视频| 91精品国产一区二区| 国产美女一区二区| 亚洲一二三四区| 精品福利二区三区| 日本精品裸体写真集在线观看 | 一本一本大道香蕉久在线精品| 午夜精品123| 日本一区二区久久| 欧美一区二区不卡视频| av激情成人网| 狠狠狠色丁香婷婷综合激情| 亚洲欧洲日韩在线| www一区二区| 6080午夜不卡| 在线一区二区三区| 成人av电影免费在线播放| 另类中文字幕网| 三级在线观看一区二区| 亚洲日本成人在线观看| 欧美激情一区二区三区不卡 | 国产精品美女久久久久久久久 | 国产精品夫妻自拍| 久久久久久久久久美女| 日韩女优制服丝袜电影| 91麻豆精品国产91久久久久久久久| 成人免费毛片片v| 成人av在线资源网站| 国产剧情一区二区三区| 国内久久婷婷综合| 国产乱国产乱300精品| 国产剧情在线观看一区二区| 国产在线一区二区综合免费视频| 久久精品久久综合| 国产精品一区二区久激情瑜伽 | 蜜桃免费网站一区二区三区| 亚洲高清免费观看| 国产伦精品一区二区三区视频青涩| 久久精品一区八戒影视| 欧美三级日韩三级| 91精品国产入口在线| 91亚洲国产成人精品一区二区三 | 91玉足脚交白嫩脚丫在线播放| 中文字幕日韩av资源站| 中文无字幕一区二区三区| 日韩视频国产视频| 日韩女优电影在线观看| 欧美高清激情brazzers| 欧美日韩电影在线| 欧美另类变人与禽xxxxx| 在线观看不卡一区| 欧美美女激情18p| 国产成人在线视频网址| 成人污视频在线观看| 91色九色蝌蚪| 日本韩国欧美一区二区三区| 国产成人综合亚洲91猫咪| 自拍偷拍国产精品| 亚洲综合色成人| 日本视频免费一区| 国产精品一区专区| zzijzzij亚洲日本少妇熟睡| 亚洲麻豆国产自偷在线| 亚洲午夜影视影院在线观看| 午夜电影一区二区三区| 激情欧美一区二区三区在线观看| 韩国三级中文字幕hd久久精品| 国产一级精品在线| 成人av一区二区三区| 在线观看欧美精品| 欧美v国产在线一区二区三区| 精品国一区二区三区| 国产精品素人视频| 免播放器亚洲一区| 91免费看视频| 精品国产91洋老外米糕| 亚洲综合久久久| 国产二区国产一区在线观看 | 精品国产亚洲在线| 亚洲激情网站免费观看| 亚洲成人av一区二区| 国产精品影音先锋| 91精品国产一区二区| 亚洲午夜久久久久久久久电影网| 久久电影国产免费久久电影| 国产91精品在线观看| 91精品国产色综合久久| 亚洲va欧美va国产va天堂影院| 99国产精品视频免费观看| 精品国产露脸精彩对白| 蜜桃久久久久久| 精品久久久久久久久久久久久久久| 亚洲免费毛片网站| 91久久香蕉国产日韩欧美9色| 欧美在线观看一区| 一级女性全黄久久生活片免费| 成人涩涩免费视频| 国产天堂亚洲国产碰碰| 国产电影一区在线| 久久久天堂av| 亚洲一区免费视频| 欧美丰满高潮xxxx喷水动漫| 天堂成人免费av电影一区| 91一区二区三区在线播放| 国产精品视频你懂的| 色婷婷精品久久二区二区蜜臀av| 中文字幕中文乱码欧美一区二区| 视频在线观看91| 精品国产乱码久久久久久闺蜜 | 美腿丝袜亚洲一区| 26uuu亚洲综合色欧美| 国产盗摄一区二区| 久久久久99精品一区| av在线不卡免费看| 天堂久久一区二区三区| 91精品中文字幕一区二区三区| 久久国产精品免费| 国产精品久久久久精k8 | 2022国产精品视频| 成人精品一区二区三区四区| 亚洲一区二区在线免费观看视频| 日韩免费视频一区二区| 99久久综合狠狠综合久久| 亚洲成人av一区| a4yy欧美一区二区三区| 天堂午夜影视日韩欧美一区二区| 精品精品国产高清a毛片牛牛| 99re这里只有精品首页| 狠狠狠色丁香婷婷综合激情| 亚洲国产日韩精品| 国产欧美日韩另类一区| 日韩欧美一区在线| 欧美丰满一区二区免费视频| 色狠狠一区二区| 91香蕉国产在线观看软件| 亚洲品质自拍视频| 亚洲人成在线播放网站岛国| 国产精品免费aⅴ片在线观看| 欧美激情一区二区三区四区| 精品电影一区二区三区 | 国产亚洲一本大道中文在线| 精品奇米国产一区二区三区| 久久久亚洲精品石原莉奈| 国产日韩欧美精品在线| av影院午夜一区| 欧美主播一区二区三区美女| 欧美色综合影院| 精品美女被调教视频大全网站| 精品理论电影在线| 国产免费成人在线视频| 亚洲免费观看视频| 亚洲国产欧美另类丝袜| 久久成人免费电影| 91色porny| 欧美精品自拍偷拍动漫精品| 欧美一区二区久久| 欧美日韩中文字幕一区| 日韩三级av在线播放| 欧美国产精品v| 夜夜精品浪潮av一区二区三区| 肉色丝袜一区二区| 一区二区在线观看免费| 性做久久久久久| 高清不卡一二三区| 在线看日本不卡| 久久久久久久久久久电影| 国产精品不卡一区| 亚洲色图制服诱惑| 精品夜夜嗨av一区二区三区| 色综合色综合色综合| 久久一二三国产| 一区二区成人在线观看| 99视频在线观看一区三区| 亚洲精品在线三区| 一区二区欧美国产| av在线不卡网| 国产精品乱码一区二区三区软件 |