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

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

?? connectionregressiontest.java

?? mysql jdbc驅動程序 mysql jdbc驅動程序 mysql jdbc驅動程序 mysql jdbc驅動程序
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
		props.remove("PORT");		props.remove("HOST");			Connection failoverConnection = null;			try {			failoverConnection = getConnectionWithProps("jdbc:mysql://"					+ newHostBuf.toString() + "/", props);					String originalConnectionId = getSingleIndexedValueWithQuery(					failoverConnection, 1, "SELECT CONNECTION_ID()").toString();						System.out.println(originalConnectionId);						Connection nextConnection = getConnectionWithProps("jdbc:mysql://"					+ newHostBuf.toString() + "/", props);						String nextId = getSingleIndexedValueWithQuery(					nextConnection, 1, "SELECT CONNECTION_ID()").toString();						System.out.println(nextId);					} finally {			if (failoverConnection != null) {				failoverConnection.close();			}		}	}		/**	 * Tests to insure proper behavior for BUG#24706.	 * 	 * @throws Exception if the test fails.	 */	public void testBug24706() throws Exception {		if (!versionMeetsMinimum(5, 0)) {			return; // server status isn't there to support this feature		}				Properties props = new Properties();		props.setProperty("elideSetAutoCommits", "true");		props.setProperty("logger", "StandardLogger");		props.setProperty("profileSQL", "true");		Connection c = null;				StringBuffer logBuf = new StringBuffer();				StandardLogger.bufferedLog = logBuf;				try {			c = getConnectionWithProps(props);			c.setAutoCommit(true);			c.createStatement().execute("SELECT 1");			c.setAutoCommit(true);			c.setAutoCommit(false);			c.createStatement().execute("SELECT 1");			c.setAutoCommit(false);						// We should only see _one_ "set autocommit=" sent to the server						String log = logBuf.toString();			int searchFrom = 0;			int count = 0;			int found = 0;						while ((found = log.indexOf("SET autocommit=", searchFrom)) != -1) {				searchFrom =  found + 1;				count++;			}						// The SELECT doesn't actually start a transaction, so being pedantic the			// driver issues SET autocommit=0 again in this case.			assertEquals(2, count);		} finally {			StandardLogger.bufferedLog = null;						if (c != null) {				c.close();			}					}	}		/**	 * Tests fix for BUG#25514 - Timer instance used for Statement.setQueryTimeout()	 * created per-connection, rather than per-VM, causing memory leak.	 * 	 * @throws Exception if the test fails.	 */	public void testBug25514() throws Exception {		for (int i = 0; i < 10; i++) {			getConnectionWithProps((Properties)null).close();		}				ThreadGroup root = Thread.currentThread().getThreadGroup().getParent();		while (root.getParent() != null) {	        root = root.getParent();	    }		int numThreadsNamedTimer = findNamedThreadCount(root, "Timer");		if (numThreadsNamedTimer == 0) {			numThreadsNamedTimer = findNamedThreadCount(root, "MySQL Statement Cancellation Timer");		}				// Notice that this seems impossible to test on JDKs prior to 1.5, as there is no		// reliable way to find the TimerThread, so we have to rely on new JDKs for this 		// test.		assertTrue("More than one timer for cancel was created", numThreadsNamedTimer <= 1);	}		private int findNamedThreadCount(ThreadGroup group, String nameStart) {				int count = 0;		        int numThreads = group.activeCount();        Thread[] threads = new Thread[numThreads*2];        numThreads = group.enumerate(threads, false);            for (int i=0; i<numThreads; i++) {            if (threads[i].getName().startsWith(nameStart)) {            	count++;            }        }        int numGroups = group.activeGroupCount();        ThreadGroup[] groups = new ThreadGroup[numGroups*2];        numGroups = group.enumerate(groups, false);            for (int i=0; i<numGroups; i++) {        	count += findNamedThreadCount(groups[i], nameStart);        }        return count;	}		/**	 * Ensures that we don't miss getters/setters for driver properties in	 * ConnectionProperties so that names given in documentation work with 	 * DataSources which will use JavaBean-style names and reflection to 	 * set the values (and often fail silently! when the method isn't available).	 * 	 * @throws Exception	 */	public void testBug23626() throws Exception {		Class clazz = this.conn.getClass();				DriverPropertyInfo[] dpi = new NonRegisteringDriver().getPropertyInfo(dbUrl, null);		StringBuffer missingSettersBuf = new StringBuffer();		StringBuffer missingGettersBuf = new StringBuffer();				Class[][] argTypes = {new Class[] { String.class }, new Class[] {Integer.TYPE}, new Class[] {Long.TYPE}, new Class[] {Boolean.TYPE}};				for (int i = 0; i < dpi.length; i++) {						String propertyName = dpi[i].name;					if (propertyName.equals("HOST") || propertyName.equals("PORT") 					|| propertyName.equals("DBNAME") || propertyName.equals("user") ||					propertyName.equals("password")) {				continue;			}								StringBuffer mutatorName = new StringBuffer("set");			mutatorName.append(Character.toUpperCase(propertyName.charAt(0)));			mutatorName.append(propertyName.substring(1));							StringBuffer accessorName = new StringBuffer("get");			accessorName.append(Character.toUpperCase(propertyName.charAt(0)));			accessorName.append(propertyName.substring(1));						try {				clazz.getMethod(accessorName.toString(), null);			} catch (NoSuchMethodException nsme) {				missingGettersBuf.append(accessorName.toString());				missingGettersBuf.append("\n");			}						boolean foundMethod = false;						for (int j = 0; j < argTypes.length; j++) {				try {					clazz.getMethod(mutatorName.toString(), argTypes[j]);					foundMethod = true;					break;				} catch (NoSuchMethodException nsme) {									}			}						if (!foundMethod) {				missingSettersBuf.append(mutatorName);				missingSettersBuf.append("\n");			}		}				assertEquals("Missing setters for listed configuration properties.", "", missingSettersBuf.toString());		assertEquals("Missing getters for listed configuration properties.", "", missingSettersBuf.toString());	}		/**	 * Tests fix for BUG#25545 - Client flags not sent correctly during handshake	 * when using SSL.	 * 	 * Requires test certificates from testsuite/ssl-test-certs to be installed	 * on the server being tested.	 * 	 * @throws Exception if the test fails.	 */	public void testBug25545() throws Exception {		if (!versionMeetsMinimum(5, 0)) {			return;		}				if (isRunningOnJdk131()) {			return;		}			createProcedure("testBug25545", "() BEGIN SELECT 1; END");				String trustStorePath = "src/testsuite/ssl-test-certs/test-cert-store";				System.setProperty("javax.net.ssl.keyStore", trustStorePath);		System.setProperty("javax.net.ssl.keyStorePassword","password");		System.setProperty("javax.net.ssl.trustStore", trustStorePath);		System.setProperty("javax.net.ssl.trustStorePassword","password");						Connection sslConn = null;				try {			Properties props = new Properties();			props.setProperty("useSSL", "true");			props.setProperty("requireSSL", "true");						sslConn = getConnectionWithProps(props);			sslConn.prepareCall("{ call testBug25545()}").execute();		} finally {			if (sslConn != null) {				sslConn.close();			}		}	}		/**	 * Tests fix for BUG#27655 - getTransactionIsolation() uses	 * "SHOW VARIABLES LIKE" which is very inefficient on MySQL-5.0+	 * 	 * @throws Exception	 */	public void testBug27655() throws Exception {		StringBuffer logBuf = new StringBuffer();		Properties props = new Properties();		props.setProperty("profileSQL", "true");		props.setProperty("logger", "StandardLogger");		StandardLogger.bufferedLog = logBuf;				Connection loggedConn = null;				try {			loggedConn = getConnectionWithProps(props);			loggedConn.getTransactionIsolation();						if (versionMeetsMinimum(4, 0, 3)) {				assertEquals(-1, logBuf.toString().indexOf("SHOW VARIABLES LIKE 'tx_isolation'"));			}		} finally {			if (loggedConn != null) {				loggedConn.close();			}		}	}		/**	 * Tests fix for issue where a failed-over connection would let	 * an application call setReadOnly(false), when that call 	 * should be ignored until the connection is reconnected to a 	 * writable master.	 * 	 * @throws Exception if the test fails.	 */	public void testFailoverReadOnly() throws Exception {		Properties props = getMasterSlaveProps();		props.setProperty("autoReconnect", "true");						Connection failoverConn = null;						Statement failoverStmt = 			null;				try {			failoverConn = getConnectionWithProps(getMasterSlaveUrl(), props);			((com.mysql.jdbc.Connection)failoverConn).setPreferSlaveDuringFailover(true);						failoverStmt = failoverConn.createStatement();						String masterConnectionId = getSingleIndexedValueWithQuery(failoverConn, 1, "SELECT connection_id()").toString();									this.stmt.execute("KILL " + masterConnectionId);						// die trying, so we get the next host			for (int i = 0; i < 100; i++) {				try {					failoverStmt.executeQuery("SELECT 1");				} catch (SQLException sqlEx) {					break;				}			}						String slaveConnectionId = getSingleIndexedValueWithQuery(failoverConn, 1, "SELECT connection_id()").toString();						assertTrue("Didn't get a new physical connection",					!masterConnectionId.equals(slaveConnectionId));						failoverConn.setReadOnly(false); // this should be ignored						assertTrue(failoverConn.isReadOnly());						((com.mysql.jdbc.Connection)failoverConn).setPreferSlaveDuringFailover(false);						this.stmt.execute("KILL " + slaveConnectionId); // we can't issue this on our own connection :p						// die trying, so we get the next host			for (int i = 0; i < 100; i++) {				try {					failoverStmt.executeQuery("SELECT 1");				} catch (SQLException sqlEx) {					break;				}			}						String newMasterId = getSingleIndexedValueWithQuery(failoverConn, 1, "SELECT connection_id()").toString();						assertTrue("Didn't get a new physical connection",					!slaveConnectionId.equals(newMasterId));						failoverConn.setReadOnly(false);						assertTrue(!failoverConn.isReadOnly());		} finally {			if (failoverStmt != null) {				failoverStmt.close();			}						if (failoverConn != null) {				failoverConn.close();			}		}	}		public void testBug29852() throws Exception {    	Connection lbConn = getLoadBalancedConnection();    	assertTrue(!lbConn.getClass().getName().startsWith("com.mysql.jdbc"));    	lbConn.close();    }	private Connection getLoadBalancedConnection() throws SQLException {		int indexOfHostStart = dbUrl.indexOf("://") + 3;    	int indexOfHostEnd = dbUrl.indexOf("/", indexOfHostStart);    	    	String backHalf = dbUrl.substring(indexOfHostStart, indexOfHostEnd);    	    	if (backHalf.length() == 0) {    		backHalf = "localhost:3306";    	}    	    	String dbAndConfigs = dbUrl.substring(indexOfHostEnd);    	    	Connection lbConn = DriverManager.getConnection("jdbc:mysql:loadbalance://" + backHalf + "," + backHalf + dbAndConfigs);		return lbConn;	}		/**	 * Test of a new feature to fix BUG 22643, specifying a	 * "validation query" in your connection pool that starts	 * with "slash-star ping slash-star" _exactly_ will cause the driver to " +	 * instead send a ping to the server (much lighter weight), and when using	 * a ReplicationConnection or a LoadBalancedConnection, will send	 * the ping across all active connections.	 * 	 * @throws Exception	 */	public void testBug22643() throws Exception {		checkPingQuery(this.conn);				Connection replConnection = getMasterSlaveReplicationConnection();				try {			checkPingQuery(replConnection);		} finally {			if (replConnection != null) {				replConnection.close();			}		}				Connection lbConn = getLoadBalancedConnection();				try {			checkPingQuery(lbConn);		} finally {			if (lbConn != null) {				lbConn.close();			}		}	}	private void checkPingQuery(Connection c) throws SQLException {		// Yes, I know we're sending 2, and looking for 1		// that's part of the test, since we don't _really_		// send the query to the server!		String aPingQuery = "/* ping */ SELECT 2";		Statement pingStmt = c.createStatement();		PreparedStatement pingPStmt = null;				try {			this.rs = pingStmt.executeQuery(aPingQuery);			assertTrue(this.rs.next());			assertEquals(this.rs.getInt(1), 1);						assertTrue(pingStmt.execute(aPingQuery));			this.rs = pingStmt.getResultSet();			assertTrue(this.rs.next());			assertEquals(this.rs.getInt(1), 1);						pingPStmt = c.prepareStatement(aPingQuery);						assertTrue(pingPStmt.execute());			this.rs = pingPStmt.getResultSet();			assertTrue(this.rs.next());			assertEquals(this.rs.getInt(1), 1);						this.rs = pingPStmt.executeQuery();			assertTrue(this.rs.next());			assertEquals(this.rs.getInt(1), 1);		} finally {			closeMemberJDBCResources();		}	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品一区精品二区高清| 亚洲欧美日韩国产综合在线| 精品福利二区三区| 久久久亚洲精品石原莉奈| 久久久亚洲午夜电影| 亚洲欧美怡红院| 无码av免费一区二区三区试看| 午夜精品福利在线| 国产精品一级二级三级| 97se亚洲国产综合自在线不卡| 欧美在线视频你懂得| 欧美午夜片在线看| 久久精品视频一区二区| 亚洲激情五月婷婷| 国产麻豆精品theporn| 91福利视频久久久久| 精品成人在线观看| 亚洲一区在线观看免费观看电影高清| 热久久国产精品| 欧美日韩中文一区| 亚洲欧美在线另类| 国产精品一区久久久久| 欧美视频在线一区二区三区 | 国产在线精品不卡| 91一区一区三区| 国产精品久久久久影院亚瑟| 美女国产一区二区| 精品日韩99亚洲| 蜜桃av一区二区三区| 欧美一区二区三区播放老司机| 亚洲激情综合网| 91色porny| 亚洲日穴在线视频| 一本色道久久加勒比精品| 国产精品人成在线观看免费| 国产精品一区一区三区| 国产亚洲一区二区三区四区| 丁香网亚洲国际| 中文字幕亚洲欧美在线不卡| 99久久99久久久精品齐齐| 国产精品毛片无遮挡高清| 不卡在线视频中文字幕| 国产精品日产欧美久久久久| 97久久超碰国产精品| 成人免费一区二区三区在线观看| 成人不卡免费av| 亚洲日本电影在线| 337p亚洲精品色噜噜狠狠| 免费在线看成人av| 国产欧美一区二区精品性色超碰| 不卡视频一二三四| 偷拍日韩校园综合在线| 国产午夜精品久久| 欧美日韩一卡二卡三卡 | 日韩欧美亚洲另类制服综合在线| 久久69国产一区二区蜜臀| 国产女人18水真多18精品一级做| 99久久99久久精品国产片果冻| 亚洲成av人在线观看| 久久久精品免费观看| 欧美日韩一区二区三区在线看 | 国产日韩欧美不卡| 91精品国产欧美一区二区| 99精品久久只有精品| 日韩在线一区二区三区| 国产精品高潮呻吟久久| 日韩女优电影在线观看| 欧美午夜理伦三级在线观看| 粉嫩av亚洲一区二区图片| 美女mm1313爽爽久久久蜜臀| 亚洲一区av在线| 亚洲男同1069视频| 亚洲少妇屁股交4| 亚洲欧洲性图库| 国产精品第五页| 国产日本欧洲亚洲| 中文字幕欧美日韩一区| 欧美精品v日韩精品v韩国精品v| 成人激情校园春色| 亚瑟在线精品视频| 视频一区二区三区在线| 手机精品视频在线观看| 日本欧美一区二区三区乱码| 亚洲成av人**亚洲成av**| 天堂成人国产精品一区| 日韩高清不卡一区| 美日韩一区二区| 国产精品一区免费视频| 成人深夜福利app| thepron国产精品| 欧美系列在线观看| 精品免费一区二区三区| 国产精品人成在线观看免费| 欧美激情在线一区二区| 亚洲一二三四在线观看| 亚洲成人av福利| 岛国精品在线播放| 欧美亚洲一区二区在线观看| 日韩欧美一二三四区| 国产精品青草综合久久久久99| 亚洲三级小视频| 日韩高清一区二区| 91小视频免费观看| 91精品免费在线观看| 国产精品国产三级国产aⅴ中文| 亚洲国产精品视频| 成人免费看片app下载| 欧美区在线观看| 欧美激情一区二区三区不卡| 亚洲日本免费电影| 成人精品电影在线观看| 欧美一级片在线看| 亚洲在线成人精品| 成人av网址在线| 久久综合久久鬼色| 蜜臀av性久久久久蜜臀aⅴ流畅 | 捆绑调教一区二区三区| 亚洲电影第三页| 欧美成人精品1314www| 欧美日韩高清一区二区不卡| 国产午夜亚洲精品羞羞网站| 美女视频第一区二区三区免费观看网站 | 精品亚洲成a人在线观看| 欧美日韩国产欧美日美国产精品| 国产精品久久久久婷婷| 成人午夜在线播放| 国产精品欧美一级免费| 国产成人免费视频网站高清观看视频| 欧美一区二区三区白人| 精品一区二区三区免费观看| 精品乱码亚洲一区二区不卡| 精品一区二区三区免费| 久久综合中文字幕| 床上的激情91.| 一区二区三区中文字幕精品精品 | 欧美日高清视频| 美腿丝袜亚洲三区| 国产精品亲子乱子伦xxxx裸| 91理论电影在线观看| 亚洲bt欧美bt精品777| 日韩亚洲欧美中文三级| 成人黄色电影在线 | 欧美国产精品一区| 欧美影视一区在线| 国产一区二区三区美女| 成人欧美一区二区三区小说| 91传媒视频在线播放| 久久精品国产亚洲高清剧情介绍| 久久久www免费人成精品| 色呦呦网站一区| 国产精品99久久久| 亚洲成人精品在线观看| 国产精品免费av| 欧美一级二级三级乱码| 亚洲影视资源网| 久久亚洲一区二区三区明星换脸 | 久久久久国产精品人| 欧美亚洲国产bt| 99精品欧美一区二区蜜桃免费 | 亚洲欧美一区二区久久| 日韩女优视频免费观看| 欧美日韩日日摸| 国产米奇在线777精品观看| 亚洲午夜精品网| 亚洲另类春色校园小说| 国产精品网站导航| 中文字幕va一区二区三区| 亚洲欧美国产77777| 久久精品综合网| 欧美激情艳妇裸体舞| 国产日本欧洲亚洲| 国产精品久久国产精麻豆99网站| 国产午夜三级一区二区三| 亚洲国产精品99久久久久久久久| 久久久久久久久久久久久夜| 久久影视一区二区| 久久久一区二区三区捆绑**| 中文字幕免费观看一区| 亚洲免费观看在线视频| 亚洲国产精品久久人人爱| 视频一区免费在线观看| 激情小说亚洲一区| 白白色 亚洲乱淫| 欧美视频日韩视频在线观看| 欧美一区二区三区人| 国产精品污www在线观看| 亚洲视频 欧洲视频| 蜜桃精品视频在线观看| 国产一区二区三区电影在线观看| 不卡电影免费在线播放一区| 欧美日韩精品久久久| 天天色图综合网| 国产69精品久久99不卡| 欧美性生交片4| 成人av免费观看| 69精品人人人人| 亚洲日本电影在线| 欧美挠脚心视频网站| 欧美成人一区二区三区在线观看| 青青草原综合久久大伊人精品优势|