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

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

?? connectiontest.java

?? 用于JAVA數(shù)據(jù)庫連接.解壓就可用,方便得很
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
			Connection newConn = getAdminConnectionWithProps(props);			newConn.createStatement().executeUpdate(					"DROP DATABASE testcreatedatabaseifnotexists");		}	}        /**     * Tests if gatherPerfMetrics works.     *      * @throws Exception if the test fails     */    public void testGatherPerfMetrics() throws Exception {        if(versionMeetsMinimum(4, 1)) {            try {                Properties props = new Properties();                props.put("autoReconnect", "true");                props.put("relaxAutoCommit", "true");                props.put("logSlowQueries", "true");                props.put("slowQueryThresholdMillis", "2000");                // these properties were reported as the cause of NullPointerException                props.put("gatherPerfMetrics", "true");                 props.put("reportMetricsIntervalMillis", "3000");                                 Connection conn1 = getConnectionWithProps(props);                Statement stmt1 = conn1.createStatement();                ResultSet rs1 = stmt1.executeQuery("SELECT 1");                rs1.next();                conn1.close();            } catch (NullPointerException e) {                e.printStackTrace();                fail();            }        }    }    /**     * Tests if useCompress works.     *      * @throws Exception if the test fails     */    public void testUseCompress() throws Exception {        Properties props = new Properties();        props.put("useCompression", "true");        props.put("traceProtocol", "true");        Connection conn1 = getConnectionWithProps(props);        Statement stmt1 = conn1.createStatement();        ResultSet rs1 = stmt1.executeQuery("SELECT VERSION()");        rs1.next();        rs1.getString(1);        stmt1.close();        conn1.close();    }        /**     * Tests feature of "localSocketAddress", by enumerating local IF's and     * trying each one in turn. This test might take a long time to run, since     * we can't set timeouts if we're using localSocketAddress. We try and keep     * the time down on the testcase by spawning the checking of each interface     * off into separate threads.     *      * @throws Exception if the test can't use at least one of the local machine's     *                   interfaces to make an outgoing connection to the server.     */    public void testLocalSocketAddress() throws Exception {    	if (isRunningOnJdk131()) {     		return;    	}    	    	Enumeration allInterfaces = NetworkInterface.getNetworkInterfaces();    	    	    	SpawnedWorkerCounter counter = new SpawnedWorkerCounter();    	    	List allChecks = new ArrayList();    	    	while (allInterfaces.hasMoreElements()) {    		NetworkInterface intf = (NetworkInterface)allInterfaces.nextElement();    		    		Enumeration allAddresses = intf.getInetAddresses();    		allChecks.add(new LocalSocketAddressCheckThread(allAddresses, counter));    	}    	    	counter.setWorkerCount(allChecks.size());    	    	for (Iterator it = allChecks.iterator(); it.hasNext();) {    		LocalSocketAddressCheckThread t = (LocalSocketAddressCheckThread)it.next();    		t.start();    	}    	    	// Wait for tests to complete....    	synchronized (counter) {    	    		while (counter.workerCount > 0 /* safety valve */) {    		    			counter.wait();    			if (counter.workerCount == 0) {    				System.out.println("Done!");    				break;    			}    		}    	}    	    	boolean didOneWork = false;    	boolean didOneFail = false;    	    	for (Iterator it = allChecks.iterator(); it.hasNext();) {    		LocalSocketAddressCheckThread t = (LocalSocketAddressCheckThread)it.next();    		if (t.atLeastOneWorked) {    			didOneWork = true;    			    			break;    		} else {    			if (!didOneFail) {    				didOneFail = true;    			}    		}    	}    	    	assertTrue("At least one connection was made with the localSocketAddress set", didOneWork);    	    	NonRegisteringDriver d = new NonRegisteringDriver();    	    	String hostname = d.host(d.parseURL(dbUrl, null));    	    	if (!hostname.startsWith(":") && !hostname.startsWith("localhost")) {    		    		int indexOfColon = hostname.indexOf(":");    		    		if (indexOfColon != -1) {    			hostname = hostname.substring(0, indexOfColon);    		}    		    		boolean isLocalIf = false;    		    		isLocalIf = (null != NetworkInterface.getByName(hostname));    		    		if (!isLocalIf) {    			try {    				isLocalIf = (null != NetworkInterface.getByInetAddress(InetAddress.getByName(hostname)));    			} catch (Throwable t) {    				isLocalIf = false;    			}    		}    		    		if (!isLocalIf) {    			assertTrue("At least one connection didn't fail with localSocketAddress set", didOneFail);    		}    	}    }        class SpawnedWorkerCounter {    	private int workerCount = 0;    	    	synchronized void setWorkerCount(int i) {    		workerCount = i;    	}    	    	synchronized void decrementWorkerCount() {    		workerCount--;    		notify();    	}    }        class LocalSocketAddressCheckThread extends Thread {    	boolean atLeastOneWorked = false;    	Enumeration allAddresses = null;    	SpawnedWorkerCounter counter = null;    	    	LocalSocketAddressCheckThread(Enumeration e, SpawnedWorkerCounter c) {    		allAddresses = e;    		counter = c;    	}    	    	public void run() {    		    		while (allAddresses.hasMoreElements()) {    			InetAddress addr = (InetAddress)allAddresses.nextElement();    			    			try {    				Properties props = new Properties();    				props.setProperty("localSocketAddress", addr.getHostAddress());    				props.setProperty("connectTimeout", "2000");    				getConnectionWithProps(props).close();    				    				atLeastOneWorked = true;    				    				break;    			} catch (SQLException sqlEx) {    				// ignore, we're only seeing if one of these tests succeeds    			}    		}    		    		counter.decrementWorkerCount();    	}    }        public void testUsageAdvisorTooLargeResultSet() throws Exception {    	Connection uaConn = null;    	    	PrintStream stderr = System.err;    	    	StringBuffer logBuf = new StringBuffer();    	    	StandardLogger.bufferedLog = logBuf;    	    	try {    		Properties props = new Properties();    		props.setProperty("useUsageAdvisor", "true");    		props.setProperty("resultSetSizeThreshold", "4");    		props.setProperty("logger", "StandardLogger");    		    		uaConn = getConnectionWithProps(props);    		    		assertTrue("Result set threshold message not present",     				logBuf.toString().indexOf("larger than \"resultSetSizeThreshold\" of 4 rows") != -1);    	} finally {    		System.setErr(stderr);    		    		closeMemberJDBCResources();    		    		if (uaConn != null) {    			uaConn.close();    		}    	}    }        public void testUseLocalSessionStateRollback() throws Exception {    	if (!versionMeetsMinimum(5, 0, 0)) {    		return;    	}    	    	Properties props = new Properties();    	props.setProperty("useLocalSessionState", "true");    	props.setProperty("profileSQL", "true");    	    	StringBuffer buf = new StringBuffer();    	StandardLogger.bufferedLog = buf;    	    	createTable("testUseLocalSessionState", "(field1 varchar(32)) ENGINE=InnoDB");    	    	Connection localStateConn = null;    	Statement localStateStmt = null;    	    	try {    		localStateConn = getConnectionWithProps(props);        	localStateStmt = localStateConn.createStatement();        		    	localStateConn.setAutoCommit(false);	    	localStateStmt.executeUpdate("INSERT INTO testUseLocalSessionState VALUES ('abc')");	    	localStateConn.rollback();	    	localStateConn.rollback();	    	localStateStmt.executeUpdate("INSERT INTO testUseLocalSessionState VALUES ('abc')");	    	localStateConn.commit();	    	localStateConn.commit();	    	localStateStmt.close();    	} finally {    		StandardLogger.bufferedLog = null;    		     		if (localStateStmt != null) {    			localStateStmt.close();    		}    		    		if (localStateConn != null) {    			localStateConn.close();    		}    	}    	    	int rollbackCount = 0;    	int rollbackPos = 0;    	    	String searchIn = buf.toString();    	    	while (rollbackPos != -1) {    		rollbackPos = searchIn.indexOf("rollback", rollbackPos);    		    		if (rollbackPos != -1) {    			rollbackPos += "rollback".length();    			rollbackCount++;    		}    	}    	    	assertEquals(1, rollbackCount);    	    	int commitCount = 0;    	int commitPos = 0;    	    	// space is important here, we don't want to count "autocommit"    	while (commitPos != -1) {    		commitPos = searchIn.indexOf(" commit", commitPos);    		    		if (commitPos != -1) {    			commitPos += " commit".length();    			commitCount++;    		}    	}    	    	assertEquals(1, commitCount);    }        /**     * Checks if setting useCursorFetch to "true" automatically     * enables server-side prepared statements.     */         public void testCouplingOfCursorFetch() throws Exception {    	if (!versionMeetsMinimum(5, 0)) {    		return;    	}    	    	Connection fetchConn = null;    	    	try {    		Properties props = new Properties();    		props.setProperty("useServerPrepStmts", "false"); // force the issue    		props.setProperty("useCursorFetch", "true");    		fetchConn = getConnectionWithProps(props);    		assertEquals("com.mysql.jdbc.ServerPreparedStatement",    				fetchConn.prepareStatement("SELECT 1").getClass().getName());    	} finally {    		if (fetchConn != null) {    			fetchConn.close();    		}    	}    }        public void testInterfaceImplementation() throws Exception {    	testInterfaceImplementation(getConnectionWithProps((Properties)null));    	MysqlConnectionPoolDataSource cpds = new MysqlConnectionPoolDataSource();    	cpds.setUrl(dbUrl);    	testInterfaceImplementation(cpds.getPooledConnection().getConnection());    }        private void testInterfaceImplementation(Connection connToCheck) throws Exception {    	Method[] dbmdMethods = java.sql.DatabaseMetaData.class.getMethods();    	    	// can't do this statically, as we return different    	// implementations depending on JDBC version    	DatabaseMetaData dbmd = connToCheck.getMetaData();    	    	checkInterfaceImplemented(dbmdMethods, dbmd.getClass(), dbmd);    	    	Statement stmtToCheck = connToCheck.createStatement();    	    	checkInterfaceImplemented(java.sql.Statement.class.getMethods(), stmtToCheck.getClass(), stmtToCheck);    	    	PreparedStatement pStmtToCheck = connToCheck.prepareStatement("SELECT 1");    	ParameterMetaData paramMd = pStmtToCheck.getParameterMetaData();    	    	checkInterfaceImplemented(java.sql.PreparedStatement.class.getMethods(), pStmtToCheck.getClass(), pStmtToCheck);    	checkInterfaceImplemented(java.sql.ParameterMetaData.class.getMethods(), paramMd.getClass(), paramMd);    	    	pStmtToCheck = ((com.mysql.jdbc.Connection) connToCheck).serverPrepareStatement("SELECT 1");    	    	checkInterfaceImplemented(java.sql.PreparedStatement.class.getMethods(), pStmtToCheck.getClass(), pStmtToCheck);    	ResultSet toCheckRs = connToCheck.createStatement().executeQuery("SELECT 1");    	checkInterfaceImplemented(java.sql.ResultSet.class.getMethods(), toCheckRs.getClass(), toCheckRs);    	toCheckRs = connToCheck.createStatement().executeQuery("SELECT 1");    	checkInterfaceImplemented(java.sql.ResultSetMetaData.class.getMethods(), toCheckRs.getMetaData().getClass(), toCheckRs.getMetaData());    	    	if (versionMeetsMinimum(5, 0, 0)) {    		createProcedure("interfaceImpl", "(IN p1 INT)\nBEGIN\nSELECT 1;\nEND");    		    		CallableStatement cstmt = connToCheck.prepareCall("{CALL interfaceImpl(?)}");    		    		checkInterfaceImplemented(java.sql.CallableStatement.class.getMethods(), cstmt.getClass(), cstmt);    	}    	checkInterfaceImplemented(java.sql.Connection.class.getMethods(), connToCheck.getClass(), connToCheck);    }	private void checkInterfaceImplemented(Method[] interfaceMethods,			Class implementingClass, Object invokeOn) throws NoSuchMethodException {		for (int i = 0; i < interfaceMethods.length; i++) {    		Method toFind = interfaceMethods[i];    		Method toMatch = implementingClass.getMethod(toFind.getName(), toFind.getParameterTypes());    		assertNotNull(toFind.toString(), toMatch);    		Object[] args = new Object[toFind.getParameterTypes().length];    		    		try {				toMatch.invoke(invokeOn, args);			} catch (IllegalArgumentException e) {							} catch (IllegalAccessException e) {							} catch (InvocationTargetException e) {							} catch (java.lang.AbstractMethodError e) {				throw e;			}    	}	}}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美色图激情小说| 久久精品国产免费| 首页国产丝袜综合| 国产精品综合网| 在线视频亚洲一区| 精品久久久久久最新网址| 中文字幕一区二区三区不卡| 天堂成人免费av电影一区| 国内精品久久久久影院薰衣草 | 久久先锋影音av鲁色资源网| 国产精品盗摄一区二区三区| 免费人成在线不卡| 日韩免费高清av| 国产精品护士白丝一区av| 日韩福利电影在线观看| 成人高清免费观看| 日韩视频在线永久播放| 亚洲黄色小视频| 国产成人精品在线看| 欧美精品一二三区| 亚洲欧洲在线观看av| 久久er精品视频| 在线观看av不卡| 欧美高清在线视频| 麻豆国产精品一区二区三区| 91福利在线免费观看| 久久久久久久久久久久久女国产乱| 亚洲自拍另类综合| 成人永久免费视频| 日韩久久免费av| 亚洲成人一区在线| 9l国产精品久久久久麻豆| 精品久久久久久最新网址| 青青草一区二区三区| 奇米综合一区二区三区精品视频| 9l国产精品久久久久麻豆| 日韩美一区二区三区| 亚洲大片免费看| 91视频在线看| 国产精品国模大尺度视频| 国内精品国产成人国产三级粉色| 777午夜精品免费视频| 亚洲综合网站在线观看| jlzzjlzz国产精品久久| 久久日韩精品一区二区五区| 日韩精品福利网| 色素色在线综合| 日韩美女久久久| 成人黄色网址在线观看| 国产欧美一区二区三区鸳鸯浴 | 精品久久久久香蕉网| 三级不卡在线观看| 欧美性猛片aaaaaaa做受| 中文字幕在线免费不卡| 成人免费观看视频| 久久精品无码一区二区三区| 国内精品视频一区二区三区八戒| 一区二区三区日韩欧美| 不卡视频在线看| 国产精品欧美精品| 成人激情免费视频| 国产精品久久久久久久久久久免费看 | 日韩一区二区三区在线| 五月天婷婷综合| 7777精品伊人久久久大香线蕉的| 亚洲成a人v欧美综合天堂下载| 欧美影院精品一区| 一区二区三区高清| 欧美午夜电影一区| 天天综合色天天| 日韩一区二区免费在线电影 | 久久一二三国产| 国产综合色在线视频区| 久久久精品天堂| 国产福利一区在线| 中文字幕一区二区三区在线不卡| 99精品国产99久久久久久白柏| 综合婷婷亚洲小说| 在线观看日韩一区| 丝袜国产日韩另类美女| 日韩欧美成人一区| 国产盗摄一区二区三区| 国产精品久久久久久久岛一牛影视 | 91精品免费观看| 香蕉久久一区二区不卡无毒影院| 91麻豆精品国产91久久久久| 久久国产婷婷国产香蕉| 久久精品一区二区三区四区| 成人高清免费观看| 亚洲一区二区在线观看视频| 欧美一区二区高清| 国产乱淫av一区二区三区| 国产精品国产三级国产| 中文字幕一区二区在线播放| 色综合天天综合在线视频| 亚洲综合激情另类小说区| 91精品国产91久久久久久最新毛片| 久久av老司机精品网站导航| 国产精品久久久爽爽爽麻豆色哟哟| 91福利小视频| 激情偷乱视频一区二区三区| 国产精品每日更新| 欧美精品日韩精品| 国产精品中文欧美| 亚洲免费观看高清| 日韩久久免费av| 91网上在线视频| 偷拍亚洲欧洲综合| 中文字幕国产一区| 欧美日韩综合不卡| 国产精品99精品久久免费| 亚洲一区二区3| 久久午夜羞羞影院免费观看| 在线视频国内自拍亚洲视频| 狠狠色丁香婷综合久久| 一区二区三区在线免费| 亚洲精品一区二区精华| 在线一区二区三区做爰视频网站| 麻豆91精品91久久久的内涵| 国产精品久久久久7777按摩| 91精品午夜视频| 色综合天天性综合| 久久99国产精品久久99果冻传媒| 亚洲色图制服丝袜| 欧美精品一区二区高清在线观看| 色久综合一二码| 国产一区二区三区黄视频 | www成人在线观看| 国产精品久线在线观看| 欧美日韩一区二区在线视频| 国产在线播放一区二区三区| 亚洲裸体xxx| 久久久久国产精品厨房| 欧美日韩在线精品一区二区三区激情| 国精产品一区一区三区mba桃花| 亚洲精品中文在线观看| 26uuu亚洲婷婷狠狠天堂| 欧美性猛交xxxx乱大交退制版| 国产成人在线视频网址| 日本在线播放一区二区三区| 亚洲人xxxx| 中文字幕av一区二区三区| 亚洲激情自拍视频| 国产亚洲精品资源在线26u| 欧美精品免费视频| 色悠悠亚洲一区二区| 成人免费视频视频在线观看免费 | 欧美成人性福生活免费看| 欧美中文字幕不卡| 99久久精品费精品国产一区二区| 黑人巨大精品欧美黑白配亚洲| 五月激情综合色| 亚洲网友自拍偷拍| 亚洲另类在线制服丝袜| 中文字幕一区三区| 中文字幕成人网| 精品免费视频.| 宅男噜噜噜66一区二区66| 欧美视频完全免费看| 91精品办公室少妇高潮对白| 99vv1com这只有精品| 丁香婷婷综合网| 国产电影精品久久禁18| 韩国欧美国产一区| 精品写真视频在线观看| 蜜臀av一级做a爰片久久| 日韩国产精品久久| 亚洲午夜一区二区| 亚洲一区二区三区四区的| 一区二区三区在线视频播放| 亚洲精品久久久久久国产精华液 | 884aa四虎影成人精品一区| 欧美天堂亚洲电影院在线播放| 欧美最猛性xxxxx直播| 色婷婷av一区二区| 在线观看日韩国产| 欧美三级电影网| 777欧美精品| 5566中文字幕一区二区电影| 337p亚洲精品色噜噜狠狠| 欧美妇女性影城| 日韩欧美aaaaaa| 久久综合99re88久久爱| 国产日韩欧美一区二区三区综合| 日本一区二区高清| 亚洲欧美日韩中文播放| 一区二区三区四区激情 | 精品美女在线播放| 国产色产综合产在线视频| 中文字幕欧美激情| 亚洲人成网站精品片在线观看 | 欧美成人精品3d动漫h| 中文字幕一区av| 亚洲综合免费观看高清完整版在线| 亚洲图片有声小说| 蜜臀av一区二区| 国产91丝袜在线播放0| 99re成人在线| 欧美日韩不卡在线| 亚洲精品一线二线三线无人区|