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

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

?? connectiontest.java

?? mysql jdbc驅動程序 mysql jdbc驅動程序 mysql jdbc驅動程序 mysql jdbc驅動程序
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
				.getProperty(NonRegisteringDriver.HOST_PROPERTY_KEY)));	}	/**	 * Tests functionality of using URLs in 'LOAD DATA LOCAL INFILE' statements.	 * 	 * @throws Exception	 *             if the test fails.	 */	public void testLocalInfileWithUrl() throws Exception {		File infile = File.createTempFile("foo", "txt");		infile.deleteOnExit();		String url = infile.toURL().toExternalForm();		FileWriter output = new FileWriter(infile);		output.write("Test");		output.flush();		output.close();		try {			this.stmt					.executeUpdate("DROP TABLE IF EXISTS testLocalInfileWithUrl");			this.stmt					.executeUpdate("CREATE TABLE testLocalInfileWithUrl (field1 LONGTEXT)");			Properties props = new Properties();			props.setProperty("allowUrlInLocalInfile", "true");			Connection loadConn = getConnectionWithProps(props);			Statement loadStmt = loadConn.createStatement();			try {				loadStmt.executeQuery("LOAD DATA LOCAL INFILE '" + url						+ "' INTO TABLE testLocalInfileWithUrl");			} catch (SQLException sqlEx) {				sqlEx.printStackTrace();				throw sqlEx;			}			this.rs = this.stmt					.executeQuery("SELECT * FROM testLocalInfileWithUrl");			assertTrue(this.rs.next());			assertTrue("Test".equals(this.rs.getString(1)));			int count = this.stmt					.executeUpdate("DELETE FROM testLocalInfileWithUrl");			assertTrue(count == 1);			StringBuffer escapedPath = new StringBuffer();			String path = infile.getCanonicalPath();			for (int i = 0; i < path.length(); i++) {				char c = path.charAt(i);				if (c == '\\') {					escapedPath.append('\\');				}				escapedPath.append(c);			}			loadStmt.executeQuery("LOAD DATA LOCAL INFILE '"					+ escapedPath.toString()					+ "' INTO TABLE testLocalInfileWithUrl");			this.rs = this.stmt					.executeQuery("SELECT * FROM testLocalInfileWithUrl");			assertTrue(this.rs.next());			assertTrue("Test".equals(this.rs.getString(1)));			try {				loadStmt						.executeQuery("LOAD DATA LOCAL INFILE 'foo:///' INTO TABLE testLocalInfileWithUrl");			} catch (SQLException sqlEx) {				assertTrue(sqlEx.getMessage() != null);				assertTrue(sqlEx.getMessage().indexOf("FileNotFoundException") != -1);			}		} finally {			this.stmt					.executeUpdate("DROP TABLE IF EXISTS testLocalInfileWithUrl");		}	}	public void testLocalInfileDisabled() throws Exception {		createTable("testLocalInfileDisabled", "(field1 varchar(255))");				File infile = File.createTempFile("foo", "txt");		infile.deleteOnExit();		String url = infile.toURL().toExternalForm();		FileWriter output = new FileWriter(infile);		output.write("Test");		output.flush();		output.close();				Connection loadConn = getConnectionWithProps(new Properties());				try {			// have to do this after connect, otherwise it's the server			// that's enforcing it			((com.mysql.jdbc.Connection)loadConn).setAllowLoadLocalInfile(false);			try {				loadConn.createStatement().execute("LOAD DATA LOCAL INFILE '" + infile.getCanonicalPath() + "' INTO TABLE testLocalInfileDisabled");				fail("Should've thrown an exception.");			} catch (SQLException sqlEx) {				assertEquals(SQLError.SQL_STATE_GENERAL_ERROR, sqlEx.getSQLState());			}						assertFalse(loadConn.createStatement().executeQuery("SELECT * FROM testLocalInfileDisabled").next());		} finally {			loadConn.close();		}	}		public void testServerConfigurationCache() throws Exception {		Properties props = new Properties();		props.setProperty("cacheServerConfiguration", "true");		props.setProperty("profileSQL", "true");		props.setProperty("logFactory", "com.mysql.jdbc.log.StandardLogger");		Connection conn1 = getConnectionWithProps(props);		StandardLogger.saveLogsToBuffer();		Connection conn2 = getConnectionWithProps(props);		assertTrue("Configuration wasn't cached", StandardLogger.bufferedLog				.toString().indexOf("SHOW VARIABLES") == -1);		if (versionMeetsMinimum(4, 1)) {			assertTrue("Configuration wasn't cached",					StandardLogger.bufferedLog.toString().indexOf(							"SHOW COLLATION") == -1);		}	}	/**	 * Tests whether or not the configuration 'useLocalSessionState' actually	 * prevents non-needed 'set autocommit=', 'set session transaction isolation	 * ...' and 'show variables like tx_isolation' queries.	 * 	 * @throws Exception	 *             if the test fails.	 */	public void testUseLocalSessionState() throws Exception {		Properties props = new Properties();		props.setProperty("useLocalSessionState", "true");		props.setProperty("profileSQL", "true");		props.setProperty("logFactory", "com.mysql.jdbc.log.StandardLogger");		Connection conn1 = getConnectionWithProps(props);		conn1.setAutoCommit(true);		conn1.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);		StandardLogger.saveLogsToBuffer();		StandardLogger.bufferedLog.setLength(0);		conn1.setAutoCommit(true);		conn1.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);		conn1.getTransactionIsolation();		String logAsString = StandardLogger.bufferedLog.toString();		assertTrue(logAsString.indexOf("SET SESSION") == -1				&& logAsString.indexOf("SHOW VARIABLES LIKE 'tx_isolation'") == -1				&& logAsString.indexOf("SET autocommit=") == -1);	}	/**	 * Tests whether re-connect with non-read-only connection can happen.	 * 	 * @throws Exception	 *             if the test fails.	 */	public void testFailoverConnection() throws Exception {		if (!isServerRunningOnWindows()) { // windows sockets don't			                               // work for this test			Properties props = new Properties();			props.setProperty("autoReconnect", "true");			props.setProperty("failOverReadOnly", "false");				// Re-build the connection information			int firstIndexOfHost = BaseTestCase.dbUrl.indexOf("//") + 2;			int lastIndexOfHost = BaseTestCase.dbUrl.indexOf("/", firstIndexOfHost);				String hostPortPair = BaseTestCase.dbUrl.substring(firstIndexOfHost,					lastIndexOfHost);			System.out.println(hostPortPair);				StringTokenizer st = new StringTokenizer(hostPortPair, ":");				String host = null;			String port = null;				if (st.hasMoreTokens()) {				String possibleHostOrPort = st.nextToken();					if (Character.isDigit(possibleHostOrPort.charAt(0)) && 						(possibleHostOrPort.indexOf(".") == -1 /* IPV4 */)  &&						(possibleHostOrPort.indexOf("::") == -1 /* IPV6 */)) {					port = possibleHostOrPort;					host = "localhost";				} else {					host = possibleHostOrPort;				}			}				if (host == null) {				host = "localhost"; 			}						if (st.hasMoreTokens()) {				port = st.nextToken();			}				StringBuffer newHostBuf = new StringBuffer();			newHostBuf.append(host);			if (port != null) {				newHostBuf.append(":");				newHostBuf.append(port);			}			newHostBuf.append(",");			newHostBuf.append(host);			if (port != null) {				newHostBuf.append(":");				newHostBuf.append(port);			}				props					.put(NonRegisteringDriver.HOST_PROPERTY_KEY, newHostBuf							.toString());				Connection failoverConnection = null;				try {				failoverConnection = getConnectionWithProps(props);					String originalConnectionId = getSingleIndexedValueWithQuery(						failoverConnection, 1, "SELECT connection_id()").toString();				System.out.println("Original Connection Id = "						+ originalConnectionId);					assertTrue("Connection should not be in READ_ONLY state",						!failoverConnection.isReadOnly());					// Kill the connection				this.stmt.executeUpdate("KILL " + originalConnectionId);					// This takes a bit to occur					Thread.sleep(3000);					try {					failoverConnection.createStatement().executeQuery("SELECT 1");					fail("We expect an exception here, because the connection should be gone until the reconnect code picks it up again");				} catch (SQLException sqlEx) {					; // do-nothing				}					// Tickle re-connect					failoverConnection.setAutoCommit(true);					String newConnectionId = getSingleIndexedValueWithQuery(						failoverConnection, 1, "SELECT connection_id()").toString();				System.out.println("new Connection Id = " + newConnectionId);					assertTrue(						"We should have a new connection to the server in this case",						!newConnectionId.equals(originalConnectionId));				assertTrue("Connection should not be read-only",						!failoverConnection.isReadOnly());			} finally {				if (failoverConnection != null) {					failoverConnection.close();				}			}		}	}	public void testCannedConfigs() throws Exception {		String url = "jdbc:mysql:///?useConfigs=clusterBase";		Properties cannedProps = new NonRegisteringDriver().parseURL(url, null);		assertTrue("true".equals(cannedProps.getProperty("autoReconnect")));		assertTrue("false".equals(cannedProps.getProperty("failOverReadOnly")));		assertTrue("true".equals(cannedProps				.getProperty("roundRobinLoadBalance")));		// this will fail, but we test that too		url = "jdbc:mysql:///?useConfigs=clusterBase,clusterBase2";		try {			cannedProps = new NonRegisteringDriver().parseURL(url, null);			fail("should've bailed on that one!");		} catch (SQLException sqlEx) {			assertTrue(SQLError.SQL_STATE_INVALID_CONNECTION_ATTRIBUTE					.equals(sqlEx.getSQLState()));		}	}	public void testUseOldUTF8Behavior() throws Exception {		Properties props = new Properties();		props.setProperty("useOldUTF8Behavior", "true");		props.setProperty("useUnicode", "true");		props.setProperty("characterEncoding", "UTF-8");		props.setProperty("logFactory", "com.mysql.jdbc.log.StandardLogger");		props.setProperty("profileSQL", "true");		StandardLogger.saveLogsToBuffer();		StandardLogger.bufferedLog.setLength(0);		try {			getConnectionWithProps(props);			assertTrue(StringUtils.indexOfIgnoreCase(StandardLogger.bufferedLog					.toString(), "SET NAMES utf8") == -1);		} finally {			StandardLogger.bufferedLog = null;		}	}	/**	 * Checks implementation of 'dontTrackOpenResources' property.	 * 	 * @throws Exception	 *             if the test fails.	 */	public void testDontTrackOpenResources() throws Exception {		Properties props = new Properties();		props.setProperty("dontTrackOpenResources", "true");		Connection noTrackConn = null;		Statement noTrackStatement = null;		PreparedStatement noTrackPstmt = null;		ResultSet rs2 = null;		try {			noTrackConn = getConnectionWithProps(props);			noTrackStatement = noTrackConn.createStatement();			noTrackPstmt = noTrackConn.prepareStatement("SELECT 1");			rs2 = noTrackPstmt.executeQuery();			rs2.next();			this.rs = noTrackStatement.executeQuery("SELECT 1");			this.rs.next();			noTrackConn.close();			// Under 'strict' JDBC requirements, these calls should fail			// (and _do_ if dontTrackOpenResources == false)			this.rs.getString(1);			rs2.getString(1);		} finally {			if (rs2 != null) {				rs2.close();			}			if (noTrackStatement != null) {				noTrackStatement.close();			}			if (noTrackConn != null & !noTrackConn.isClosed()) {				noTrackConn.close();			}		}	}	public void testPing() throws SQLException {		Connection conn2 = getConnectionWithProps((Properties)null);		((com.mysql.jdbc.Connection) conn2).ping();		conn2.close();		try {			((com.mysql.jdbc.Connection) conn2).ping();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女视频黄a大片欧美| 日韩一区国产二区欧美三区| 国产精品久久看| 成人激情小说网站| 亚洲色图制服丝袜| 91成人在线观看喷潮| 亚洲第一会所有码转帖| 在线观看91av| 国产一区二区三区四| 国产精品久久久久影院亚瑟| 91免费看`日韩一区二区| 午夜欧美一区二区三区在线播放| 欧美日韩精品一区二区天天拍小说| 麻豆国产精品777777在线| 久久欧美中文字幕| 91社区在线播放| 日日噜噜夜夜狠狠视频欧美人| 欧美精品一区二区在线观看| 不卡一区在线观看| 日韩激情在线观看| 国产欧美一区二区精品秋霞影院 | 亚洲婷婷综合色高清在线| 日本韩国欧美一区二区三区| 男女性色大片免费观看一区二区| 国产欧美一区二区三区在线老狼 | 在线综合亚洲欧美在线视频| 国产麻豆精品视频| 亚瑟在线精品视频| 欧美国产激情一区二区三区蜜月| 欧美自拍偷拍一区| 国产精品一区二区在线看| 亚洲国产成人porn| 久久久久久久久久久久久久久99| 欧美自拍丝袜亚洲| 粉嫩av亚洲一区二区图片| 午夜在线成人av| 中文字幕视频一区| 久久综合久久99| 欧美色视频在线观看| 国产成人高清在线| 日本欧美一区二区| 一区二区三区视频在线观看| 国产日本欧洲亚洲| 日韩一区二区高清| 欧美亚洲国产一区二区三区| 高清国产一区二区三区| 日本最新不卡在线| 亚洲午夜私人影院| 国产精品国产三级国产aⅴ入口| 欧美一区二区三区白人| 在线欧美小视频| 91丨九色丨国产丨porny| 国产精品资源站在线| 日本中文字幕一区| 婷婷中文字幕综合| 亚洲永久精品国产| 亚洲色图一区二区| 亚洲欧洲三级电影| 国产精品三级在线观看| 久久久久久久久97黄色工厂| 日韩久久久精品| 欧美影视一区二区三区| 一本一本大道香蕉久在线精品| 国产91精品露脸国语对白| 麻豆极品一区二区三区| 日本不卡123| 美女在线视频一区| 美腿丝袜在线亚洲一区| 免费观看一级欧美片| 免费成人美女在线观看.| 亚洲一区二区高清| 亚洲一线二线三线视频| 亚洲成人动漫精品| 丝袜亚洲另类欧美| 蜜臀久久99精品久久久久久9| 香蕉久久一区二区不卡无毒影院| 亚洲午夜一区二区| 日韩国产精品大片| 精品一区二区三区久久| 老司机精品视频在线| 狠狠狠色丁香婷婷综合激情 | 欧美不卡123| 日韩欧美在线不卡| 久久久综合九色合综国产精品| 久久午夜电影网| 亚洲国产高清不卡| 亚洲色欲色欲www在线观看| 亚洲精品你懂的| 五月婷婷久久丁香| 激情六月婷婷综合| 波多野结衣一区二区三区 | 欧美在线观看视频一区二区| 色婷婷综合在线| 欧美日韩一区成人| 欧美精品一区在线观看| 国产精品久久久久久久浪潮网站| 亚洲美女偷拍久久| 日本 国产 欧美色综合| 国产成人免费在线观看| 色呦呦一区二区三区| 7777精品伊人久久久大香线蕉的| 欧美不卡一二三| 亚洲欧美另类图片小说| 亚洲v精品v日韩v欧美v专区| 国产在线一区二区综合免费视频| 丁香婷婷综合激情五月色| 91官网在线免费观看| 欧美一区二区三区在线| 亚洲国产精品精华液2区45| 一级中文字幕一区二区| 免费在线看一区| 成人黄色在线视频| 日韩一级免费一区| 中文字幕一区二区三区在线播放 | 麻豆精品新av中文字幕| 成人h动漫精品一区二区| 欧美日韩一区二区在线观看 | 亚洲激情自拍偷拍| 美美哒免费高清在线观看视频一区二区 | 在线成人av网站| 国产精品无码永久免费888| 日韩在线观看一区二区| 99综合电影在线视频| 日韩一区二区三区在线观看| 国产精品麻豆视频| 免费观看成人av| 日本丶国产丶欧美色综合| 欧美大片在线观看一区| 亚洲免费观看高清完整版在线| 久久国产精品第一页| 日本高清视频一区二区| 欧美国产1区2区| 精品在线播放午夜| 欧美午夜一区二区三区免费大片| 国产午夜精品一区二区三区视频| 天天射综合影视| 91原创在线视频| 国产精品天干天干在线综合| 美女视频黄频大全不卡视频在线播放| 色先锋资源久久综合| 日本一区二区三区在线观看| 日本aⅴ免费视频一区二区三区| 色就色 综合激情| 国产精品白丝在线| 成人av电影免费在线播放| 久久这里只有精品视频网| 天天综合日日夜夜精品| 欧美性一区二区| 亚洲欧美一区二区三区国产精品| 高清在线不卡av| 欧美国产欧美综合| 成人性生交大合| 国产欧美日韩另类一区| 国产精品中文字幕欧美| 国产亚洲一区二区在线观看| 奇米888四色在线精品| 欧美一级欧美三级| 偷偷要91色婷婷| 91精品国产色综合久久不卡蜜臀| 偷拍一区二区三区四区| 在线播放亚洲一区| 天天综合日日夜夜精品| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 日本一区二区免费在线| 国产黄色精品网站| 国产婷婷一区二区| 国产不卡视频在线观看| 精品国产伦一区二区三区观看体验 | 久久久青草青青国产亚洲免观| 奇米综合一区二区三区精品视频| 91丨porny丨最新| 亚洲一卡二卡三卡四卡五卡| 欧美亚洲高清一区| 日韩精品亚洲专区| 精品播放一区二区| 国产高清精品网站| 自拍偷拍国产亚洲| 欧美亚洲日本一区| 理论电影国产精品| 日本一区二区三区视频视频| 成人福利视频在线看| 亚洲另类在线一区| 欧美日韩国产片| 久久99精品久久久久久国产越南| 日韩欧美一二区| 国产99久久久久| 一区二区三区中文免费| 欧美一区二区成人| 久久er精品视频| 久久综合av免费| 91同城在线观看| 日韩电影在线一区二区三区| 久久久久久一级片| 99久久综合国产精品| 国产精品婷婷午夜在线观看| 欧美视频一区二区三区在线观看| 日韩 欧美一区二区三区| 国产精品热久久久久夜色精品三区| 色狠狠桃花综合| 肉色丝袜一区二区|