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

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

?? statementstest.java

?? 用于JAVA數據庫連接.解壓就可用,方便得很
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
				assertEquals(insertIdFromGeneratedKeys, insertIdFromServer);			}		} finally {			if (this.rs != null) {				try {					this.rs.close();				} catch (Exception ex) { /* ignore */					;				}			}			this.rs = null;		}	}	/**	 * Tests multiple statement support	 *	 * @throws Exception	 *             DOCUMENT ME!	 */	public void testMultiStatements() throws Exception {		if (versionMeetsMinimum(4, 1)) {			Connection multiStmtConn = null;			Statement multiStmt = null;			try {				Properties props = new Properties();				props.setProperty("allowMultiQueries", "true");				multiStmtConn = getConnectionWithProps(props);				multiStmt = multiStmtConn.createStatement();				multiStmt						.executeUpdate("DROP TABLE IF EXISTS testMultiStatements");				multiStmt						.executeUpdate("CREATE TABLE testMultiStatements (field1 VARCHAR(255), field2 INT, field3 DOUBLE)");				multiStmt						.executeUpdate("INSERT INTO testMultiStatements VALUES ('abcd', 1, 2)");				multiStmt						.execute("SELECT field1 FROM testMultiStatements WHERE field1='abcd';"								+ "UPDATE testMultiStatements SET field3=3;"								+ "SELECT field3 FROM testMultiStatements WHERE field3=3");				this.rs = multiStmt.getResultSet();				assertTrue(this.rs.next());				assertTrue("abcd".equals(this.rs.getString(1)));				this.rs.close();				// Next should be an update count...				assertTrue(!multiStmt.getMoreResults());				assertTrue("Update count was " + multiStmt.getUpdateCount()						+ ", expected 1", multiStmt.getUpdateCount() == 1);				assertTrue(multiStmt.getMoreResults());				this.rs = multiStmt.getResultSet();				assertTrue(this.rs.next());				assertTrue(this.rs.getDouble(1) == 3);				// End of multi results				assertTrue(!multiStmt.getMoreResults());				assertTrue(multiStmt.getUpdateCount() == -1);			} finally {				if (multiStmt != null) {					multiStmt							.executeUpdate("DROP TABLE IF EXISTS testMultiStatements");					multiStmt.close();				}				if (multiStmtConn != null) {					multiStmtConn.close();				}			}		}	}	/**	 * Tests that NULLs and '' work correctly.	 *	 * @throws SQLException	 *             if an error occurs	 */	public void testNulls() throws SQLException {		try {			this.stmt.executeUpdate("DROP TABLE IF EXISTS nullTest");			this.stmt					.executeUpdate("CREATE TABLE IF NOT EXISTS nullTest (field_1 CHAR(20), rowOrder INT)");			this.stmt					.executeUpdate("INSERT INTO nullTest VALUES (null, 1), ('', 2)");			this.rs = this.stmt					.executeQuery("SELECT field_1 FROM nullTest ORDER BY rowOrder");			this.rs.next();			assertTrue("NULL field not returned as NULL", (this.rs					.getString("field_1") == null)					&& this.rs.wasNull());			this.rs.next();			assertTrue("Empty field not returned as \"\"", this.rs.getString(					"field_1").equals("")					&& !this.rs.wasNull());			this.rs.close();		} finally {			if (this.rs != null) {				try {					this.rs.close();				} catch (Exception ex) {					// ignore				}			}			this.stmt.executeUpdate("DROP TABLE IF EXISTS nullTest");		}	}	public void testParsedConversionWarning() throws Exception {		if (versionMeetsMinimum(4, 1)) {			try {				Properties props = new Properties();				props.setProperty("useUsageAdvisor", "true");				Connection warnConn = getConnectionWithProps(props);				this.stmt						.executeUpdate("DROP TABLE IF EXISTS testParsedConversionWarning");				this.stmt						.executeUpdate("CREATE TABLE testParsedConversionWarning(field1 VARCHAR(255))");				this.stmt						.executeUpdate("INSERT INTO testParsedConversionWarning VALUES ('1.0')");				PreparedStatement badStmt = warnConn						.prepareStatement("SELECT field1 FROM testParsedConversionWarning");				this.rs = badStmt.executeQuery();				assertTrue(this.rs.next());				this.rs.getFloat(1);			} finally {				this.stmt						.executeUpdate("DROP TABLE IF EXISTS testParsedConversionWarning");			}		}	}	/**	 * DOCUMENT ME!	 *	 * @throws SQLException	 *             DOCUMENT ME!	 */	public void testPreparedStatement() throws SQLException {		this.stmt				.executeUpdate("INSERT INTO statement_test (id, strdata1,strdata2) values (999,'abcdefg', 'poi')");		this.pstmt = this.conn				.prepareStatement("UPDATE statement_test SET strdata1=?, strdata2=? where id=999");		this.pstmt.setString(1, "iop");		this.pstmt.setString(2, "higjklmn");		// pstmt.setInt(3, 999);		int updateCount = this.pstmt.executeUpdate();		assertTrue("Update count must be '1', was '" + updateCount + "'",				(updateCount == 1));		this.pstmt.clearParameters();		this.pstmt.close();		this.rs = this.stmt				.executeQuery("SELECT id, strdata1, strdata2 FROM statement_test");		assertTrue(this.rs.next());		assertTrue(this.rs.getInt(1) == 999);		assertTrue("Expected 'iop', received '" + this.rs.getString(2) + "'",				"iop".equals(this.rs.getString(2)));		assertTrue("Expected 'higjklmn', received '" + this.rs.getString(3)				+ "'", "higjklmn".equals(this.rs.getString(3)));	}	/**	 * DOCUMENT ME!	 *	 * @throws SQLException	 *             DOCUMENT ME!	 */	public void testPreparedStatementBatch() throws SQLException {		this.pstmt = this.conn.prepareStatement("INSERT INTO "				+ "statement_batch_test (strdata1, strdata2) VALUES (?,?)");		for (int i = 0; i < 1000; i++) {			this.pstmt.setString(1, "batch_" + i);			this.pstmt.setString(2, "batch_" + i);			this.pstmt.addBatch();		}		int[] updateCounts = this.pstmt.executeBatch();		for (int i = 0; i < updateCounts.length; i++) {			assertTrue("Update count must be '1', was '" + updateCounts[i]					+ "'", (updateCounts[i] == 1));		}	}	public void testRowFetch() throws Exception {		if (versionMeetsMinimum(5, 0, 5)) {			createTable("testRowFetch", "(field1 int)");			this.stmt.executeUpdate("INSERT INTO testRowFetch VALUES (1)");			Connection fetchConn = null;			Properties props = new Properties();			props.setProperty("useCursorFetch", "true");			try {				fetchConn = getConnectionWithProps(props);				PreparedStatement fetchStmt = fetchConn						.prepareStatement("SELECT field1 FROM testRowFetch WHERE field1=1");				fetchStmt.setFetchSize(10);				this.rs = fetchStmt.executeQuery();				assertTrue(this.rs.next());				this.stmt.executeUpdate("INSERT INTO testRowFetch VALUES (2), (3)");				fetchStmt = fetchConn						.prepareStatement("SELECT field1 FROM testRowFetch ORDER BY field1");				fetchStmt.setFetchSize(1);				this.rs = fetchStmt.executeQuery();				assertTrue(this.rs.next());				assertEquals(1, this.rs.getInt(1));				assertTrue(this.rs.next());				assertEquals(2, this.rs.getInt(1));				assertTrue(this.rs.next());				assertEquals(3, this.rs.getInt(1));				assertEquals(false, this.rs.next());				fetchStmt.executeQuery();			} finally {				if (fetchConn != null) {					fetchConn.close();				}			}		}	}	/**	 * DOCUMENT ME!	 *	 * @throws SQLException	 *             DOCUMENT ME!	 */	public void testSelectColumns() throws SQLException {		for (int i = 6; i < MAX_COLUMNS_TO_TEST; i += STEP) {			long start = System.currentTimeMillis();			this.rs = this.stmt					.executeQuery("SELECT * from statement_col_test_" + i);			if (this.rs.next()) {				;			}			long end = System.currentTimeMillis();			System.out.println(i + " columns = " + (end - start) + " ms");		}	}	/**	 * Tests for PreparedStatement.setObject()	 *	 * @throws Exception	 */	public void testSetObject() throws Exception {		Properties props = new Properties();		props.put("noDatetimeStringSync", "true"); // value=true for #5		Connection conn1 = getConnectionWithProps(props);		Statement stmt1 = conn1.createStatement();		stmt1.executeUpdate("DROP TABLE IF EXISTS t1");		stmt1.executeUpdate("CREATE TABLE t1 (" + "c1 DECIMAL," // instance of																// String				+ "c2 VARCHAR(255)," // instance of String				+ "c3 BLOB," // instance of byte[]				+ "c4 DATE," // instance of java.util.Date				+ "c5 TIMESTAMP," // instance of String				+ "c6 TIME," // instance of String				+ "c7 TIME)"); // instance of java.sql.Timestamp		this.pstmt = conn1				.prepareStatement("INSERT INTO t1 VALUES (?, ?, ?, ?, ?, ?, ?)");		long currentTime = System.currentTimeMillis();		this.pstmt.setObject(1, "1000", Types.DECIMAL);		this.pstmt.setObject(2, "2000", Types.VARCHAR);		this.pstmt.setObject(3, new byte[] { 0 }, Types.BLOB);		this.pstmt.setObject(4, new java.util.Date(currentTime), Types.DATE);		this.pstmt.setObject(5, "2000-01-01 23-59-59", Types.TIMESTAMP);		this.pstmt.setObject(6, "11:22:33", Types.TIME);		this.pstmt				.setObject(7, new java.sql.Timestamp(currentTime), Types.TIME);		this.pstmt.execute();		this.rs = stmt1.executeQuery("SELECT * FROM t1");		this.rs.next();		assertEquals("1000", this.rs.getString(1));		assertEquals("2000", this.rs.getString(2));		assertEquals(1, ((byte[]) this.rs.getObject(3)).length);		assertEquals(0, ((byte[]) this.rs.getObject(3))[0]);		assertEquals(new java.sql.Date(currentTime).toString(), this.rs				.getDate(4).toString());		if (versionMeetsMinimum(4, 1)) {			assertEquals("2000-01-01 23:59:59", this.rs.getString(5));		} else {			assertEquals("20000101235959", this.rs.getString(5));		}		assertEquals("11:22:33", this.rs.getString(6));		assertEquals(new java.sql.Time(currentTime).toString(), this.rs				.getString(7));	}	public void testStatementRewriteBatch() throws Exception {		for (int j = 0; j < 2; j++) {			Properties props = new Properties();			if (j == 0) {				props.setProperty("useServerPrepStmts", "true");			}			props.setProperty("rewriteBatchedStatements", "true");			Connection multiConn = getConnectionWithProps(props);			createTable("testStatementRewriteBatch", "(pk_field INT PRIMARY KEY NOT NULL AUTO_INCREMENT, field1 INT)");			Statement multiStmt = multiConn.createStatement();			multiStmt.addBatch("INSERT INTO testStatementRewriteBatch(field1) VALUES (1)");			multiStmt.addBatch("INSERT INTO testStatementRewriteBatch(field1) VALUES (2)");			multiStmt.addBatch("INSERT INTO testStatementRewriteBatch(field1) VALUES (3)");			multiStmt.addBatch("INSERT INTO testStatementRewriteBatch(field1) VALUES (4)");			multiStmt.addBatch("UPDATE testStatementRewriteBatch SET field1=5 WHERE field1=1");			multiStmt.addBatch("UPDATE testStatementRewriteBatch SET field1=6 WHERE field1=2 OR field1=3");			int[] counts = multiStmt.executeBatch();			if (!isRunningOnJdk131()) {				ResultSet genKeys = multiStmt.getGeneratedKeys();				for (int i = 1; i < 5; i++) {					genKeys.next();					assertEquals(i, genKeys.getInt(1));				}			}			assertEquals(counts.length, 6);			assertEquals(counts[0], 1);			assertEquals(counts[1], 1);			assertEquals(counts[2], 1);			assertEquals(counts[3], 1);			assertEquals(counts[4], 1);			assertEquals(counts[5], 2);			this.rs = multiStmt.executeQuery("SELECT field1 FROM testStatementRewriteBatch ORDER BY field1");			assertTrue(this.rs.next());			assertEquals(this.rs.getInt(1), 4);			assertTrue(this.rs.next());			assertEquals(this.rs.getInt(1), 5);			assertTrue(this.rs.next());			assertEquals(this.rs.getInt(1), 6);			assertTrue(this.rs.next());			assertEquals(this.rs.getInt(1), 6);			createTable("testStatementRewriteBatch", "(pk_field INT PRIMARY KEY NOT NULL AUTO_INCREMENT, field1 INT)");			props.clear();			props.setProperty("rewriteBatchedStatements", "true");			props.setProperty("sessionVariables", "max_allowed_packet=1024");			multiConn = getConnectionWithProps(props);			multiStmt = multiConn.createStatement();			for (int i = 0; i < 1000; i++) {				multiStmt.addBatch("INSERT INTO testStatementRewriteBatch(field1) VALUES (" + i + ")");			}			multiStmt.executeBatch();			if (!isRunningOnJdk131()) {				ResultSet genKeys = multiStmt.getGeneratedKeys();				for (int i = 1; i < 1000; i++) {					genKeys.next();					assertEquals(i, genKeys.getInt(1));				}			}			createTable("testStatementRewriteBatch", "(pk_field INT PRIMARY KEY NOT NULL AUTO_INCREMENT, field1 INT)");			props.clear();			props.setProperty("useServerPrepStmts", j == 0 ? "true" : "false");			props.setProperty("rewriteBatchedStatements", "true");			multiConn = getConnectionWithProps(props);			PreparedStatement pStmt = null;			if (!isRunningOnJdk131()) {				pStmt = multiConn.prepareStatement("INSERT INTO testStatementRewriteBatch(field1) VALUES (?)",						Statement.RETURN_GENERATED_KEYS);				for (int i = 0; i < 1000; i++) {					pStmt.setInt(1, i);					pStmt.addBatch();				}				pStmt.executeBatch();				ResultSet genKeys = pStmt.getGeneratedKeys();				for (int i = 1; i < 1000; i++) {					genKeys.next();					assertEquals(i, genKeys.getInt(1));				}			}			createTable("testStatementRewriteBatch", "(pk_field INT PRIMARY KEY NOT NULL AUTO_INCREMENT, field1 INT)");			props.setProperty("useServerPrepStmts", j == 0 ? "true" : "false");			props.setProperty("rewriteBatchedStatements", "true");			props.setProperty("sessionVariables", "max_allowed_packet=1024");			multiConn = getConnectionWithProps(props);			if (!isRunningOnJdk131()) {				pStmt = multiConn.prepareStatement("INSERT INTO testStatementRewriteBatch(field1) VALUES (?)",					Statement.RETURN_GENERATED_KEYS);				for (int i = 0; i < 1000; i++) {					pStmt.setInt(1, i);					pStmt.addBatch();				}				pStmt.executeBatch();				ResultSet genKeys = pStmt.getGeneratedKeys();				for (int i = 1; i < 1000; i++) {					genKeys.next();					assertEquals(i, genKeys.getInt(1));				}			}			Object[][] differentTypes = new Object[1000][14];			createTable("rewriteBatchTypes", "(internalOrder int, f1 tinyint null, "					+ "f2 smallint null, f3 int null, f4 bigint null, "					+ "f5 decimal(8, 2) null, f6 float null, f7 double null, "					+ "f8 varchar(255) null, f9 text null, f10 blob null, "					+ "f11 blob null, f12 datetime null, f13 time null, f14 date null)");			for (int i = 0; i < 1000; i++) {				differentTypes[i][0] = Math.random() < .5 ? null : new Byte((byte)(Math.random() * 127));				differentTypes[i][1] = Math.random() < .5 ? null : new Short((short)(Math.random() * Short.MAX_VALUE));				differentTypes[i][2] = Math.random() < .5 ? null : new Integer((int)(Math.random() * Integer.MAX_VALUE));				differentTypes[i][3] = Math.random() < .5 ? null : new Long((long)(Math.random() * Long.MAX_VALUE));				differentTypes[i][4] = Math.random() < .5 ? null : new BigDecimal("19.95");				differentTypes[i][5] = Math.random() < .5 ? null : new Float(3 + ((float)(Math.random())));				differentTypes[i][6] = Math.random() < .5 ? null : new Double(3 + (Math.random()));				differentTypes[i][7] = Math.random() < .5 ? null : randomString();				differentTypes[i][8] = Math.random() < .5 ? null : randomString();				differentTypes[i][9] = Math.random() < .5 ? null : randomString().getBytes();				differentTypes[i][10] = Math.random() < .5 ? null : randomString().getBytes();				differentTypes[i][11] = Math.random() < .5 ? null : new Timestamp(System.currentTimeMillis());				differentTypes[i][12] = Math.random() < .5 ? null : new Time(System.currentTimeMillis());				differentTypes[i][13] = Math.random() < .5 ? null : new Date(System.currentTimeMillis());			}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩一区二区三区视频| 色94色欧美sute亚洲线路一久 | 久久精品亚洲乱码伦伦中文| 亚洲人成精品久久久久| 蜜桃免费网站一区二区三区| 色综合网色综合| 国产亚洲欧美中文| 青草av.久久免费一区| 在线免费一区三区| 国产精品视频第一区| 紧缚捆绑精品一区二区| 欧美日韩一二区| 亚洲视频在线一区| 国产福利一区在线| 2023国产一二三区日本精品2022| 亚洲一区在线视频观看| 97aⅴ精品视频一二三区| 国产中文一区二区三区| 亚洲成精国产精品女| 成人影视亚洲图片在线| 欧美一级夜夜爽| 亚洲成人av免费| 91亚洲午夜精品久久久久久| 国产欧美精品一区| 国产九九视频一区二区三区| 精品乱码亚洲一区二区不卡| 午夜精品123| 欧洲一区在线电影| 亚洲免费视频成人| 日本韩国一区二区| 一区二区三区欧美日韩| 在线视频国产一区| 一区二区视频在线看| 91热门视频在线观看| 亚洲国产精品v| 成人午夜免费视频| 中文字幕一区二区三区视频| 国产一区二区中文字幕| 日韩欧美一级二级三级| 九一久久久久久| 日韩欧美三级在线| 国产在线国偷精品产拍免费yy| 欧美成人bangbros| 国产成人精品三级麻豆| 中文字幕在线不卡一区二区三区| 99精品国产99久久久久久白柏| 亚洲丝袜制服诱惑| 欧美网站大全在线观看| 日韩电影免费在线| 亚洲精品一区二区三区精华液| 久久99精品国产麻豆不卡| 国产亚洲污的网站| 91麻豆6部合集magnet| 亚洲久草在线视频| 欧美羞羞免费网站| 五月婷婷欧美视频| 欧美精品第1页| 国产精品无人区| 99热精品国产| 一区二区三区色| 欧美日韩成人一区| 蜜桃久久久久久| 欧美精品一区二区三| 国产在线日韩欧美| 国产精品黄色在线观看| 91黄色免费网站| 亚洲电影第三页| 精品奇米国产一区二区三区| 国产一区二区免费视频| 国产精品免费网站在线观看| 91首页免费视频| 亚洲一级二级三级| 欧美午夜片在线看| 免费一级片91| 欧美激情资源网| 一本一本久久a久久精品综合麻豆| 一区二区三区高清在线| 欧美大黄免费观看| 成人av免费在线播放| 午夜影院在线观看欧美| 久久嫩草精品久久久精品 | 91精品国产一区二区人妖| 日本系列欧美系列| 国产亚洲福利社区一区| 色天使色偷偷av一区二区| 日韩精品亚洲一区| 国产精品少妇自拍| 91精品国产综合久久福利| 成人黄色电影在线| 五月天激情综合| 国产精品久久久久久久久搜平片 | 国产aⅴ精品一区二区三区色成熟| 日韩理论片网站| 欧美一区中文字幕| 不卡的av网站| 精品一区二区三区免费毛片爱| 成人免费在线观看入口| 亚洲国产精品传媒在线观看| 欧美日韩视频在线第一区| 日韩中文字幕麻豆| 亚洲国产精华液网站w| 在线观看91av| 在线观看av一区二区| 高清国产午夜精品久久久久久| 午夜电影一区二区| 1000精品久久久久久久久| 精品国产乱码久久久久久老虎| 色香蕉久久蜜桃| 成人少妇影院yyyy| 一二三四社区欧美黄| 久久精品一区二区三区不卡| 欧美日韩久久不卡| 成人高清免费观看| 激情综合网天天干| 理论片日本一区| 午夜精品久久久久久不卡8050| 亚洲少妇最新在线视频| 欧美一级淫片007| 欧美性色欧美a在线播放| 91香蕉国产在线观看软件| 国产乱码精品一区二区三区av | 国产精品久久久久一区二区三区| 日韩精品一区二区三区老鸭窝 | 久久精品久久综合| 日韩精品亚洲一区二区三区免费| 一区二区三区在线播放| 成人免费在线播放视频| 欧美激情一区二区三区蜜桃视频| 久久综合色播五月| 久久亚洲精品国产精品紫薇| 久久久国产综合精品女国产盗摄| 日韩女优av电影| 精品国内二区三区| 精品国产91亚洲一区二区三区婷婷| 91精品中文字幕一区二区三区| 777奇米四色成人影色区| 欧美日韩大陆在线| 这里只有精品视频在线观看| 欧美精品日日鲁夜夜添| 91成人国产精品| 在线观看一区日韩| 欧美日韩国产片| 成人av动漫在线| 欧美在线视频全部完| 欧美色中文字幕| 欧美日韩国产a| 欧美一区二区在线免费观看| 欧美一区二区三区四区在线观看| 7777女厕盗摄久久久| 日韩欧美美女一区二区三区| 欧美mv日韩mv国产网站app| 欧美精品一区二区三区一线天视频 | 久久成人久久鬼色| 久久精品国产99国产| 国产一区二区按摩在线观看| 26uuu另类欧美亚洲曰本| 国产精品久久久久9999吃药| 一区二区三区成人在线视频| 免费三级欧美电影| 国产不卡高清在线观看视频| 日本高清无吗v一区| 日韩一区国产二区欧美三区| 欧美欧美午夜aⅴ在线观看| 亚洲综合色网站| 国产麻豆91精品| 欧美美女bb生活片| 亚洲天堂网中文字| 国产91精品在线观看| 日韩欧美另类在线| 亚洲最新在线观看| 欧美性做爰猛烈叫床潮| 亚洲三级在线观看| av色综合久久天堂av综合| 国产亚洲欧美在线| 韩国三级在线一区| 欧美成人艳星乳罩| 午夜伊人狠狠久久| 日韩一区二区三区视频在线| 亚洲高清在线精品| 日本大香伊一区二区三区| 亚洲三级电影网站| 99这里只有精品| 国产精品欧美一区喷水| 国产aⅴ综合色| 18成人在线观看| 色综合天天在线| 亚洲美女在线一区| 91福利精品第一导航| 亚洲免费三区一区二区| 91高清在线观看| 天天亚洲美女在线视频| 一本久久精品一区二区| 自拍偷拍国产亚洲| 91成人在线精品| 午夜精品免费在线观看| 在线亚洲一区观看| 麻豆精品久久久| 国产亚洲综合在线| aaa亚洲精品| 一区二区三区四区在线免费观看|