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

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

?? statementstest.java

?? 用于JAVA數(shù)據(jù)庫連接.解壓就可用,方便得很
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
			props.setProperty("useServerPrepStmts", j == 0 ? "true" : "false");			props.setProperty("rewriteBatchedStatements", "true");			props.setProperty("sessionVariables", "max_allowed_packet=1024");			multiConn = getConnectionWithProps(props);			pStmt = multiConn.prepareStatement("INSERT INTO rewriteBatchTypes(internalOrder,f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");			for (int i = 0; i < 1000; i++) {				pStmt.setInt(1, i);				for (int k = 0; k < 14; k++) {					if (k == 8) {						String asString = (String)differentTypes[i][k];						if (asString == null) {							pStmt.setObject(k + 2, null);						} else {							pStmt.setCharacterStream(k + 2, new StringReader(asString), asString.length());						}					} else if (k == 9) {						byte[] asBytes = (byte[])differentTypes[i][k];						if (asBytes == null) {							pStmt.setObject(k + 2, null);						} else {							pStmt.setBinaryStream(k + 2, new ByteArrayInputStream(asBytes), asBytes.length);						}					} else {						pStmt.setObject(k + 2, differentTypes[i][k]);					}				}				pStmt.addBatch();			}			pStmt.executeBatch();			this.rs = this.stmt.executeQuery("SELECT f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14 FROM rewriteBatchTypes ORDER BY internalOrder");			int idx = 0;			// We need to format this ourselves, since we have to strip the nanos off of			// TIMESTAMPs, so .equals() doesn't really work...			SimpleDateFormat sdf = new SimpleDateFormat("''yyyy-MM-dd HH:mm:ss''", Locale.US);			while (this.rs.next()) {				for (int k = 0; k < 14; k++) {					if (differentTypes[idx][k] == null) {						assertTrue("On row " + idx + " expected NULL, found " + this.rs.getObject(k + 1)								+ " in column " + (k + 1), this.rs.getObject(k + 1) == null);					} else {						String className = differentTypes[idx][k].getClass().getName();						if (className.equals("java.io.StringReader")) {							StringReader reader = (StringReader)differentTypes[idx][k];							StringBuffer buf = new StringBuffer();							int c = 0;							while ((c = reader.read()) != -1) {								buf.append((char)c);							}							String asString = this.rs.getString(k + 1);							assertEquals("On row " + idx + ", column " + (k + 1), buf.toString(), asString);						} else if (differentTypes[idx][k] instanceof java.io.InputStream) {							ByteArrayOutputStream bOut = new ByteArrayOutputStream();							int bytesRead = 0;							byte[] buf = new byte[128];							InputStream in = (InputStream)differentTypes[idx][k];							while ((bytesRead = in.read(buf)) != -1) {								bOut.write(buf, 0, bytesRead);							}							byte[] expected = bOut.toByteArray();							byte[] actual = this.rs.getBytes(k + 1);							assertEquals("On row " + idx + ", column " + (k + 1), StringUtils.dumpAsHex(expected, expected.length), StringUtils.dumpAsHex(actual, actual.length));						} else if (differentTypes[idx][k] instanceof byte[]) {							byte[] expected = (byte[])differentTypes[idx][k];							byte[] actual = this.rs.getBytes(k + 1);							assertEquals("On row " + idx + ", column " + (k + 1), StringUtils.dumpAsHex(expected, expected.length), StringUtils.dumpAsHex(actual, actual.length));						} else if (differentTypes[idx][k] instanceof Timestamp) {							assertEquals("On row " + idx + ", column " + (k + 1), sdf.format(differentTypes[idx][k]), sdf.format(this.rs.getObject(k + 1)));						} else if (differentTypes[idx][k] instanceof Double) {							assertEquals("On row " + idx + ", column " + (k + 1), ((Double)differentTypes[idx][k]).doubleValue(), this.rs.getDouble(k + 1), .1);						} else if (differentTypes[idx][k] instanceof Float) {							assertEquals("On row " + idx + ", column " + (k + 1), ((Float)differentTypes[idx][k]).floatValue(), this.rs.getFloat(k + 1), .1);						} else if (className.equals("java.lang.Byte")) {							// special mapping in JDBC for ResultSet.getObject()							assertEquals("On row " + idx + ", column " + (k + 1), new Integer(((Byte)differentTypes[idx][k]).byteValue()), this.rs.getObject(k + 1));						} else if (className.equals("java.lang.Short")) {							// special mapping in JDBC for ResultSet.getObject()							assertEquals("On row " + idx + ", column " + (k + 1), new Integer(((Short)differentTypes[idx][k]).shortValue()), this.rs.getObject(k + 1));						} else {							assertEquals("On row " + idx + ", column " + (k + 1) + " (" + differentTypes[idx][k].getClass() + "/" + this.rs.getObject(k + 1).getClass(), differentTypes[idx][k].toString(), this.rs.getObject(k + 1).toString());						}					}				}				idx++;			}		}	}		public void testBatchRewriteErrors() throws Exception {		createTable("rewriteErrors", "(field1 int not null primary key)");		Properties props = new Properties();		Connection multiConn = null;		for (int j = 0; j < 2; j++) {			props.setProperty("useServerPrepStmts", "false");				if (j == 1) {				props.setProperty("continueBatchOnError", "false");			}						props.setProperty("sessionVariables", "max_allowed_packet=1024");			props.setProperty("rewriteBatchedStatements", "true");			multiConn = getConnectionWithProps(props);			this.pstmt = multiConn.prepareStatement("INSERT INTO rewriteErrors VALUES (?)");			Statement multiStmt = multiConn.createStatement();						for (int i = 0; i < 4096; i++) {				multiStmt.addBatch("INSERT INTO rewriteErrors VALUES (" + i + ")");				this.pstmt.setInt(1, i);				this.pstmt.addBatch();			}						multiStmt.addBatch("INSERT INTO rewriteErrors VALUES (2048)");						this.pstmt.setInt(1, 2048);			this.pstmt.addBatch();						try {				this.pstmt.executeBatch();			} catch (BatchUpdateException bUpE) {				int[] counts = bUpE.getUpdateCounts();					for (int i = 4059; i < counts.length; i++) {					assertEquals(counts[i], Statement.EXECUTE_FAILED);				}								assertEquals(4096, getRowCount("rewriteErrors"));			}						this.stmt.execute("TRUNCATE TABLE rewriteErrors");						try {				multiStmt.executeBatch();			} catch (BatchUpdateException bUpE) {				int[] counts = bUpE.getUpdateCounts();					for (int i = 4094; i < counts.length; i++) {					assertEquals(counts[i], Statement.EXECUTE_FAILED);				}								assertEquals(4096, getRowCount("rewriteErrors"));			}						if (versionMeetsMinimum(5, 0)) {				this.stmt.execute("TRUNCATE TABLE rewriteErrors");								createProcedure("sp_rewriteErrors", "(param1 INT)\nBEGIN\nINSERT INTO rewriteErrors VALUES (param1);\nEND");								CallableStatement cStmt = multiConn.prepareCall("{ CALL sp_rewriteErrors(?)}");								for (int i = 0; i < 4096; i++) {					cStmt.setInt(1, i);					cStmt.addBatch();				}								cStmt.setInt(1, 2048);				cStmt.addBatch();								try {					cStmt.executeBatch();				} catch (BatchUpdateException bUpE) {					int[] counts = bUpE.getUpdateCounts();						for (int i = 4093; i < counts.length; i++) {						assertEquals(counts[i], Statement.EXECUTE_FAILED);					}										assertEquals(4096, getRowCount("rewriteErrors"));				}			}		}	}	public void testStreamChange() throws Exception {		createTable("testStreamChange",				"(field1 varchar(32), field2 int, field3 TEXT, field4 BLOB)");		this.pstmt = this.conn				.prepareStatement("INSERT INTO testStreamChange VALUES (?, ?, ?, ?)");		try {			this.pstmt.setString(1, "A");			this.pstmt.setInt(2, 1);			char[] cArray = { 'A', 'B', 'C' };			Reader r = new CharArrayReader(cArray);			this.pstmt.setCharacterStream(3, r, cArray.length);			byte[] bArray = { 'D', 'E', 'F' };			ByteArrayInputStream bais = new ByteArrayInputStream(bArray);			this.pstmt.setBinaryStream(4, bais, bArray.length);			assertEquals(1, this.pstmt.executeUpdate());			this.rs = this.stmt					.executeQuery("SELECT field3, field4 from testStreamChange where field1='A'");			this.rs.next();			assertEquals("ABC", this.rs.getString(1));			assertEquals("DEF", this.rs.getString(2));			char[] ucArray = { 'C', 'E', 'S', 'U' };			this.pstmt.setString(1, "CESU");			this.pstmt.setInt(2, 3);			Reader ucReader = new CharArrayReader(ucArray);			this.pstmt.setCharacterStream(3, ucReader, ucArray.length);			this.pstmt.setBinaryStream(4, null, 0);			assertEquals(1, this.pstmt.executeUpdate());			this.rs = this.stmt					.executeQuery("SELECT field3, field4 from testStreamChange where field1='CESU'");			this.rs.next();			assertEquals("CESU", this.rs.getString(1));			assertEquals(null, this.rs.getString(2));		} finally {			if (this.rs != null) {				this.rs.close();				this.rs = null;			}			if (this.pstmt != null) {				this.pstmt.close();				this.pstmt = null;			}		}	}	/**	 * DOCUMENT ME!	 *	 * @throws SQLException	 *             DOCUMENT ME!	 */	public void testStubbed() throws SQLException {		if (!isRunningOnJdk131()) {			try {				this.stmt.getResultSetHoldability();			} catch (NotImplemented notImplEx) {				;			}		}	}	public void testTruncationOnRead() throws Exception {		this.rs = this.stmt.executeQuery("SELECT '" + Long.MAX_VALUE + "'");		this.rs.next();		try {			this.rs.getByte(1);			fail("Should've thrown an out-of-range exception");		} catch (SQLException sqlEx) {			assertTrue(SQLError.SQL_STATE_NUMERIC_VALUE_OUT_OF_RANGE					.equals(sqlEx.getSQLState()));		}		try {			this.rs.getShort(1);			fail("Should've thrown an out-of-range exception");		} catch (SQLException sqlEx) {			assertTrue(SQLError.SQL_STATE_NUMERIC_VALUE_OUT_OF_RANGE					.equals(sqlEx.getSQLState()));		}		try {			this.rs.getInt(1);			fail("Should've thrown an out-of-range exception");		} catch (SQLException sqlEx) {			assertTrue(SQLError.SQL_STATE_NUMERIC_VALUE_OUT_OF_RANGE					.equals(sqlEx.getSQLState()));		}		this.rs = this.stmt.executeQuery("SELECT '" + Double.MAX_VALUE + "'");		this.rs.next();		try {			this.rs.getByte(1);			fail("Should've thrown an out-of-range exception");		} catch (SQLException sqlEx) {			assertTrue(SQLError.SQL_STATE_NUMERIC_VALUE_OUT_OF_RANGE					.equals(sqlEx.getSQLState()));		}		try {			this.rs.getShort(1);			fail("Should've thrown an out-of-range exception");		} catch (SQLException sqlEx) {			assertTrue(SQLError.SQL_STATE_NUMERIC_VALUE_OUT_OF_RANGE					.equals(sqlEx.getSQLState()));		}		try {			this.rs.getInt(1);			fail("Should've thrown an out-of-range exception");		} catch (SQLException sqlEx) {			assertTrue(SQLError.SQL_STATE_NUMERIC_VALUE_OUT_OF_RANGE					.equals(sqlEx.getSQLState()));		}		try {			this.rs.getLong(1);			fail("Should've thrown an out-of-range exception");		} catch (SQLException sqlEx) {			assertTrue(SQLError.SQL_STATE_NUMERIC_VALUE_OUT_OF_RANGE					.equals(sqlEx.getSQLState()));		}		try {			this.rs.getLong(1);			fail("Should've thrown an out-of-range exception");		} catch (SQLException sqlEx) {			assertTrue(SQLError.SQL_STATE_NUMERIC_VALUE_OUT_OF_RANGE					.equals(sqlEx.getSQLState()));		}		PreparedStatement pStmt = null;		System.out				.println("Testing prepared statements with binary result sets now");		try {			this.stmt					.executeUpdate("DROP TABLE IF EXISTS testTruncationOnRead");			this.stmt					.executeUpdate("CREATE TABLE testTruncationOnRead(intField INTEGER, bigintField BIGINT, doubleField DOUBLE)");			this.stmt.executeUpdate("INSERT INTO testTruncationOnRead VALUES ("					+ Integer.MAX_VALUE + ", " + Long.MAX_VALUE + ", "					+ Double.MAX_VALUE + ")");			this.stmt.executeUpdate("INSERT INTO testTruncationOnRead VALUES ("					+ Integer.MIN_VALUE + ", " + Long.MIN_VALUE + ", "					+ Double.MIN_VALUE + ")");			pStmt = this.conn					.prepareStatement("SELECT intField, bigintField, doubleField FROM testTruncationOnRead ORDER BY intField DESC");			this.rs = pStmt.executeQuery();			this.rs.next();			try {				this.rs.getByte(1);				fail("Should've thrown an out-of-range exception");			} catch (SQLException sqlEx) {				assertTrue(SQLError.SQL_STATE_NUMERIC_VALUE_OUT_OF_RANGE						.equals(sqlEx.getSQLState()));			}			try {				this.rs.getInt(2);				fail("Should've thrown an out-of-range exception");			} catch (SQLException sqlEx) {				assertTrue(SQLError.SQL_STATE_NUMERIC_VALUE_OUT_OF_RANGE						.equals(sqlEx.getSQLState()));			}			try {				this.rs.getLong(3);				fail("Should've thrown an out-of-range exception");			} catch (SQLException sqlEx) {				assertTrue(SQLError.SQL_STATE_NUMERIC_VALUE_OUT_OF_RANGE						.equals(sqlEx.getSQLState()));			}		} finally {			this.stmt					.executeUpdate("DROP TABLE IF EXISTS testTruncationOnRead");		}	}	public void testStatementInterceptors() throws Exception {		Connection interceptedConn = null;		/*		try {			Properties props = new Properties();			props.setProperty("statementInterceptors", "com.mysql.jdbc.interceptors.ResultSetScannerInterceptor");			props.setProperty("resultSetScannerRegex", ".*");			interceptedConn = getConnectionWithProps(props);			this.rs = interceptedConn.createStatement().executeQuery("SELECT 'abc'");			this.rs.next();			this.rs.getString(1);		} finally {			closeMemberJDBCResources();			if (interceptedConn != null) {				interceptedConn.close();			}		}		*/		try {			Properties props = new Properties();			props.setProperty("statementInterceptors", "com.mysql.jdbc.interceptors.ServerStatusDiffInterceptor");			interceptedConn = getConnectionWithProps(props);			this.rs = interceptedConn.createStatement().executeQuery("SELECT 'abc'");		} finally {			closeMemberJDBCResources();			if (interceptedConn != null) {				interceptedConn.close();			}		}	}	public void testParameterBindings() throws Exception {		// Need to check character set stuff, so need a new connection		Connection utfConn = getConnectionWithProps("characterEncoding=utf-8");		java.util.Date now = new java.util.Date();		Object[] valuesToTest = new Object[] {				new Byte(Byte.MIN_VALUE),				new Short(Short.MIN_VALUE),				new Integer(Integer.MIN_VALUE),				new Long(Long.MIN_VALUE),				new Double(Double.MIN_VALUE),				"\u4E2D\u6587",				new BigDecimal(Math.PI),				null, // to test isNull				now // to test serialization		};		StringBuffer statementText = new StringBuffer("SELECT ?");		for (int i = 1; i < valuesToTest.length; i++) {			statementText.append(",?");		}		this.pstmt = utfConn.prepareStatement(statementText.toString());		for (int i = 0; i < valuesToTest.length; i++) {			this.pstmt.setObject(i + 1, valuesToTest[i]);		}		ParameterBindings bindings = ((com.mysql.jdbc.PreparedStatement)this.pstmt).getParameterBindings();		for (int i = 0; i < valuesToTest.length; i++) {			assertEquals(bindings.getObject(i + 1), valuesToTest[i]);		}	}	public void testLocalInfileHooked() throws Exception {	    createTable("localInfileHooked", "(field1 int, field2 varchar(255))");	    String streamData = "1\tabcd\n2\tefgh\n3\tijkl";	    InputStream stream = new ByteArrayInputStream(streamData.getBytes());	    try {	        ((com.mysql.jdbc.Statement) this.stmt).setLocalInfileInputStream(stream);	        this.stmt.execute("LOAD DATA LOCAL INFILE 'bogusFileName' INTO TABLE localInfileHooked");	        assertEquals(-1, stream.read());	        this.rs = this.stmt.executeQuery("SELECT field2 FROM localInfileHooked ORDER BY field1 ASC");	        this.rs.next();	        assertEquals("abcd", this.rs.getString(1));	        this.rs.next();            assertEquals("efgh", this.rs.getString(1));            this.rs.next();            assertEquals("ijkl", this.rs.getString(1));	    } finally {	        ((com.mysql.jdbc.Statement) this.stmt).setLocalInfileInputStream(null);	        closeMemberJDBCResources();	    }	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃视频一区二区三区 | 成人av在线播放网址| 伦理电影国产精品| 天天操天天色综合| 亚洲自拍偷拍欧美| 亚洲蜜臀av乱码久久精品| 国产精品久久久久久亚洲伦| 久久久午夜精品| 欧美sm美女调教| 日韩精品一区二区三区三区免费 | 国产成人丝袜美腿| 日韩中文字幕亚洲一区二区va在线| 亚洲综合在线观看视频| 国产精品国产三级国产aⅴ中文 | 久久精品国产亚洲a| 欧美aⅴ一区二区三区视频| 亚洲国产日韩一级| 午夜久久电影网| 日韩精品高清不卡| 亚洲成av人片| 美国十次综合导航| 国产精品三级久久久久三级| 中文乱码免费一区二区| 精品国产免费视频| 国产视频一区二区在线观看| 国产精品丝袜91| 亚洲精品五月天| 亚洲一区二区黄色| 午夜精品一区二区三区电影天堂| 亚洲综合区在线| 天堂资源在线中文精品| 蜜桃视频在线一区| 国产剧情在线观看一区二区| 成人激情av网| 91成人免费在线视频| 欧美精品日韩一区| 日韩一区二区三区在线观看| 久久久一区二区| 亚洲欧洲成人精品av97| 亚洲va欧美va人人爽午夜| 亚洲主播在线观看| 国产一区二区三区在线观看免费 | 337p粉嫩大胆色噜噜噜噜亚洲| 欧美人狂配大交3d怪物一区| 欧美高清你懂得| www国产亚洲精品久久麻豆| 中文字幕日韩一区二区| 亚洲国产日韩在线一区模特| 国产在线播放一区| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 亚洲免费观看高清完整版在线观看 | 日韩成人av影视| 久久综合综合久久综合| 精品亚洲成av人在线观看| 99视频热这里只有精品免费| 91免费视频观看| 欧美电影免费观看完整版 | 国内国产精品久久| 99久久久久久| 日韩精品一区二区三区四区| 国产精品女人毛片| 亚洲国产日韩精品| 蜜桃视频免费观看一区| av不卡在线播放| 欧美视频完全免费看| 91精品国产全国免费观看 | 欧美性大战久久久| 精品国产精品网麻豆系列| 欧美韩国日本不卡| 日本免费在线视频不卡一不卡二| 无码av免费一区二区三区试看| 国产福利精品导航| 欧美精品粉嫩高潮一区二区| 国产精品嫩草影院av蜜臀| 免费av成人在线| 欧美天堂亚洲电影院在线播放| 精品国产凹凸成av人导航| 亚洲精品免费在线观看| 激情五月激情综合网| 日本久久电影网| 成人免费小视频| 男人操女人的视频在线观看欧美 | 亚洲午夜免费电影| 成人激情开心网| 欧美剧情片在线观看| 亚洲免费色视频| 美女一区二区三区在线观看| 91高清在线观看| 日韩欧美一二三四区| 日韩国产精品91| 国产成人一区在线| 精品国产伦一区二区三区观看方式| 亚洲制服欧美中文字幕中文字幕| 97久久精品人人澡人人爽| 欧美videossexotv100| 奇米四色…亚洲| 欧美色网站导航| 中文字幕佐山爱一区二区免费| 国产成人欧美日韩在线电影| 日韩精品一区在线| 男人的j进女人的j一区| 欧美日韩视频专区在线播放| 亚洲成在人线在线播放| 日本道精品一区二区三区| 自拍偷拍国产亚洲| 成人av电影免费观看| 日韩码欧中文字| 97国产精品videossex| 久久先锋影音av鲁色资源网| 久久国产精品99精品国产| 在线影视一区二区三区| 亚洲综合色成人| 欧美系列在线观看| 日韩一区精品视频| 欧美高清激情brazzers| 久久黄色级2电影| 精品剧情在线观看| 国产91精品精华液一区二区三区| 久久久99精品免费观看不卡| 国产又黄又大久久| 国产清纯白嫩初高生在线观看91| 久久精品免费观看| 中文字幕免费观看一区| 成人精品视频一区二区三区尤物| 亚洲三级免费电影| 色综合天天性综合| 婷婷成人激情在线网| 欧美猛男超大videosgay| 久久精品国产精品亚洲综合| 日韩你懂的在线播放| 成人国产精品视频| 亚洲黄网站在线观看| 欧美性一二三区| 亚洲一区二区欧美日韩| 欧美人体做爰大胆视频| 日本欧美一区二区| 久久在线观看免费| 成人av资源在线观看| 亚洲综合在线五月| 日韩欧美久久一区| 国产精品自在在线| 欧美亚洲另类激情小说| xf在线a精品一区二区视频网站| 国内一区二区在线| 日韩无一区二区| 国产精品系列在线播放| 亚洲精品欧美专区| 欧美成人一区二区| av网站免费线看精品| 日韩和欧美一区二区| 久久理论电影网| 欧美日韩的一区二区| 国内精品伊人久久久久影院对白| 亚洲三级在线免费| 欧美一级欧美一级在线播放| 99久久久精品| 热久久国产精品| 18欧美乱大交hd1984| 91精品国产色综合久久ai换脸| 成人激情av网| 五月天久久比比资源色| 国产精品三级av| 欧美一区二区三区日韩视频| 国产精品一品二品| 亚洲一区二区三区美女| 欧美国产精品一区二区三区| 欧美日韩一区成人| 久久精品国产99国产精品| 亚洲一区二区三区中文字幕在线| 欧美二区三区91| 91猫先生在线| 国内外成人在线| 五月天亚洲精品| 中文字幕亚洲成人| 久久久久久久久蜜桃| 精品视频999| 91视频一区二区三区| 韩国中文字幕2020精品| 日韩av网站在线观看| 亚洲欧洲日本在线| 中文文精品字幕一区二区| 欧美美女视频在线观看| 在线亚洲高清视频| 丁香六月久久综合狠狠色| 激情成人午夜视频| 五月天精品一区二区三区| 亚洲午夜久久久久久久久电影网| 久久久www成人免费毛片麻豆| 欧美肥妇bbw| 一本久道久久综合中文字幕| 青娱乐精品视频| 亚洲欧美在线另类| 日韩网站在线看片你懂的| 99re这里只有精品视频首页| 国产99久久久国产精品免费看 | 国产日韩在线不卡| 久久这里都是精品| 欧美怡红院视频| 在线观看亚洲一区| 国产精品一区二区不卡|