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

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

?? resultsetregressiontest.java

?? mysql jdbc驅動程序 mysql jdbc驅動程序 mysql jdbc驅動程序 mysql jdbc驅動程序
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
/* Copyright (C) 2002-2007 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. There are special exceptions to the terms and conditions of the GPL as it is applied to this software. View the full text of the exception in file EXCEPTIONS-CONNECTOR-J in the directory of this software distribution. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */package testsuite.regression;import java.io.Reader;import java.lang.reflect.Array;import java.lang.reflect.InvocationTargetException;import java.lang.reflect.Method;import java.math.BigDecimal;import java.sql.CallableStatement;import java.sql.Clob;import java.sql.Connection;import java.sql.DatabaseMetaData;import java.sql.Date;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.ResultSetMetaData;import java.sql.SQLException;import java.sql.Statement;import java.sql.Timestamp;import java.sql.Types;import java.util.ArrayList;import java.util.Calendar;import java.util.GregorianCalendar;import java.util.List;import java.util.Locale;import java.util.Properties;import java.util.TimeZone;import testsuite.BaseTestCase;import com.mysql.jdbc.Messages;import com.mysql.jdbc.MysqlDataTruncation;import com.mysql.jdbc.NotUpdatable;import com.mysql.jdbc.SQLError;import com.mysql.jdbc.StringUtils;import com.mysql.jdbc.log.StandardLogger;/** * Regression test cases for the ResultSet class. * * @author Mark Matthews */public class ResultSetRegressionTest extends BaseTestCase {	/**	 * Creates a new ResultSetRegressionTest	 *	 * @param name	 *            the name of the test to run	 */	public ResultSetRegressionTest(String name) {		super(name);	}	/**	 * Runs all test cases in this test suite	 *	 * @param args	 */	public static void main(String[] args) {		junit.textui.TestRunner.run(ResultSetRegressionTest.class);	}	/**	 * Tests fix for BUG#???? -- Numeric types and server-side prepared	 * statements incorrectly detect nulls.	 *	 * @throws Exception	 *             if the test fails	 */	public void testBug2359() throws Exception {		try {			/*			 * this.stmt.executeUpdate("DROP TABLE IF EXISTS testBug2359");			 * this.stmt.executeUpdate("CREATE TABLE testBug2359 (field1 INT)			 * TYPE=InnoDB"); this.stmt.executeUpdate("INSERT INTO testBug2359			 * VALUES (null), (1)");			 *			 * this.pstmt = this.conn.prepareStatement("SELECT field1 FROM			 * testBug2359 WHERE field1 IS NULL"); this.rs =			 * this.pstmt.executeQuery();			 *			 * assertTrue(this.rs.next());			 *			 * assertTrue(this.rs.getByte(1) == 0);			 * assertTrue(this.rs.wasNull());			 *			 * assertTrue(this.rs.getShort(1) == 0);			 * assertTrue(this.rs.wasNull());			 *			 * assertTrue(this.rs.getInt(1) == 0);			 * assertTrue(this.rs.wasNull());			 *			 * assertTrue(this.rs.getLong(1) == 0);			 * assertTrue(this.rs.wasNull());			 *			 * assertTrue(this.rs.getFloat(1) == 0);			 * assertTrue(this.rs.wasNull());			 *			 * assertTrue(this.rs.getDouble(1) == 0);			 * assertTrue(this.rs.wasNull());			 *			 * assertTrue(this.rs.getBigDecimal(1) == null);			 * assertTrue(this.rs.wasNull());			 *			 * this.rs.close();			 *			 * this.pstmt = this.conn.prepareStatement("SELECT max(field1) FROM			 * testBug2359 WHERE field1 IS NOT NULL"); this.rs =			 * this.pstmt.executeQuery(); assertTrue(this.rs.next());			 *			 * assertTrue(this.rs.getByte(1) == 1);			 * assertTrue(!this.rs.wasNull());			 *			 * assertTrue(this.rs.getShort(1) == 1);			 * assertTrue(!this.rs.wasNull());			 *			 * assertTrue(this.rs.getInt(1) == 1);			 * assertTrue(!this.rs.wasNull());			 *			 * assertTrue(this.rs.getLong(1) == 1);			 * assertTrue(!this.rs.wasNull());			 *			 * assertTrue(this.rs.getFloat(1) == 1);			 * assertTrue(!this.rs.wasNull());			 *			 * assertTrue(this.rs.getDouble(1) == 1);			 * assertTrue(!this.rs.wasNull());			 *			 * assertTrue(this.rs.getBigDecimal(1) != null);			 * assertTrue(!this.rs.wasNull());			 *			 */			this.stmt.executeUpdate("DROP TABLE IF EXISTS testBug2359_1");			this.stmt					.executeUpdate("CREATE TABLE testBug2359_1 (id INT) TYPE=InnoDB");			this.stmt.executeUpdate("INSERT INTO testBug2359_1 VALUES (1)");			this.pstmt = this.conn					.prepareStatement("SELECT max(id) FROM testBug2359_1");			this.rs = this.pstmt.executeQuery();			if (this.rs.next()) {				assertTrue(this.rs.getInt(1) != 0);				this.rs.close();			}			this.rs.close();		} finally {			this.stmt.executeUpdate("DROP TABLE IF EXISTS testBug2359_1");			this.stmt.executeUpdate("DROP TABLE IF EXISTS testBug2359");			this.rs.close();			this.pstmt.close();		}	}	/**	 * Tests fix for BUG#2643, ClassCastException when using this.rs.absolute()	 * and server-side prepared statements.	 *	 * @throws Exception	 */	public void testBug2623() throws Exception {		PreparedStatement pStmt = null;		try {			pStmt = this.conn					.prepareStatement("SELECT NOW()",							ResultSet.TYPE_SCROLL_SENSITIVE,							ResultSet.CONCUR_READ_ONLY);			this.rs = pStmt.executeQuery();			this.rs.absolute(1);		} finally {			if (this.rs != null) {				this.rs.close();			}			this.rs = null;			if (pStmt != null) {				pStmt.close();			}		}	}	/**	 * Tests fix for BUG#2654, "Column 'column.table' not found" when "order by"	 * in query"	 *	 * @throws Exception	 *             if the test fails	 */	public void testBug2654() throws Exception {		if (false) { // this is currently a server-level bug			try {				this.stmt.executeUpdate("DROP TABLE IF EXISTS foo");				this.stmt.executeUpdate("DROP TABLE IF EXISTS bar");				this.stmt.executeUpdate("CREATE TABLE foo ("						+ "  id tinyint(3) default NULL,"						+ "  data varchar(255) default NULL"						+ ") TYPE=MyISAM DEFAULT CHARSET=latin1");				this.stmt						.executeUpdate("INSERT INTO foo VALUES (1,'male'),(2,'female')");				this.stmt.executeUpdate("CREATE TABLE bar ("						+ "id tinyint(3) unsigned default NULL,"						+ "data char(3) default '0'"						+ ") TYPE=MyISAM DEFAULT CHARSET=latin1");				this.stmt						.executeUpdate("INSERT INTO bar VALUES (1,'yes'),(2,'no')");				String statement = "select foo.id, foo.data, "						+ "bar.data from foo, bar" + "	where "						+ "foo.id = bar.id order by foo.id";				String column = "foo.data";				this.rs = this.stmt.executeQuery(statement);				ResultSetMetaData rsmd = this.rs.getMetaData();				System.out.println(rsmd.getTableName(1));				System.out.println(rsmd.getColumnName(1));				this.rs.next();				String fooData = this.rs.getString(column);			} finally {				this.stmt.executeUpdate("DROP TABLE IF EXISTS foo");				this.stmt.executeUpdate("DROP TABLE IF EXISTS bar");			}		}	}	/**	 * Tests for fix to BUG#1130	 *	 * @throws Exception	 *             if the test fails	 */	public void testClobTruncate() throws Exception {		if (isRunningOnJdk131()) {			return; // test not valid on JDK-1.3.1		}		try {			this.stmt.executeUpdate("DROP TABLE IF EXISTS testClobTruncate");			this.stmt					.executeUpdate("CREATE TABLE testClobTruncate (field1 TEXT)");			this.stmt					.executeUpdate("INSERT INTO testClobTruncate VALUES ('abcdefg')");			this.rs = this.stmt.executeQuery("SELECT * FROM testClobTruncate");			this.rs.next();			Clob clob = this.rs.getClob(1);			clob.truncate(3);			Reader reader = clob.getCharacterStream();			char[] buf = new char[8];			int charsRead = reader.read(buf);			String clobAsString = new String(buf, 0, charsRead);			assertTrue(clobAsString.equals("abc"));		} finally {			this.stmt.executeUpdate("DROP TABLE IF EXISTS testClobTruncate");		}	}	/**	 * Tests that streaming result sets are registered correctly.	 *	 * @throws Exception	 *             if any errors occur	 */	public void testClobberStreamingRS() throws Exception {		try {			Properties props = new Properties();			props.setProperty("clobberStreamingResults", "true");			Connection clobberConn = getConnectionWithProps(props);			Statement clobberStmt = clobberConn.createStatement();			clobberStmt.executeUpdate("DROP TABLE IF EXISTS StreamingClobber");			clobberStmt					.executeUpdate("CREATE TABLE StreamingClobber ( DUMMYID "							+ " INTEGER NOT NULL, DUMMYNAME VARCHAR(32),PRIMARY KEY (DUMMYID) )");			clobberStmt					.executeUpdate("INSERT INTO StreamingClobber (DUMMYID, DUMMYNAME) VALUES (0, NULL)");			clobberStmt					.executeUpdate("INSERT INTO StreamingClobber (DUMMYID, DUMMYNAME) VALUES (1, 'nro 1')");			clobberStmt					.executeUpdate("INSERT INTO StreamingClobber (DUMMYID, DUMMYNAME) VALUES (2, 'nro 2')");			clobberStmt					.executeUpdate("INSERT INTO StreamingClobber (DUMMYID, DUMMYNAME) VALUES (3, 'nro 3')");			Statement streamStmt = null;			try {				streamStmt = clobberConn.createStatement(						java.sql.ResultSet.TYPE_FORWARD_ONLY,						java.sql.ResultSet.CONCUR_READ_ONLY);				streamStmt.setFetchSize(Integer.MIN_VALUE);				this.rs = streamStmt.executeQuery("SELECT DUMMYID, DUMMYNAME "						+ "FROM StreamingClobber ORDER BY DUMMYID");				this.rs.next();				// This should proceed normally, after the driver				// clears the input stream				clobberStmt.executeQuery("SHOW VARIABLES");				this.rs.close();			} finally {				if (streamStmt != null) {					streamStmt.close();				}			}		} finally {			this.stmt.executeUpdate("DROP TABLE IF EXISTS StreamingClobber");		}	}	/**	 * DOCUMENT ME!	 *	 * @throws Exception	 *             DOCUMENT ME!	 */	public void testEmptyResultSetGet() throws Exception {		try {			this.rs = this.stmt.executeQuery("SHOW VARIABLES LIKE 'foo'");			System.out.println(this.rs.getInt(1));		} catch (SQLException sqlEx) {			assertTrue("Correct exception not thrown",					SQLError.SQL_STATE_GENERAL_ERROR							.equals(sqlEx.getSQLState()));		}	}	/**	 * Checks fix for BUG#1592 -- cross-database updatable result sets are not	 * checked for updatability correctly.	 *	 * @throws Exception	 *             if the test fails.	 */	public void testFixForBug1592() throws Exception {		if (versionMeetsMinimum(4, 1)) {			Statement updatableStmt = this.conn					.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,							ResultSet.CONCUR_UPDATABLE);			try {				updatableStmt.execute("SELECT * FROM mysql.user");				this.rs = updatableStmt.getResultSet();			} catch (SQLException sqlEx) {				String message = sqlEx.getMessage();				if ((message != null) && (message.indexOf("denied") != -1)) {					System.err							.println("WARN: Can't complete testFixForBug1592(), access to"									+ " 'mysql' database not allowed");				} else {					throw sqlEx;				}			}		}	}	/**	 * Tests fix for BUG#2006, where 2 columns with same name in a result set	 * are returned via findColumn() in the wrong order...The JDBC spec states,	 * that the _first_ matching column should be returned.	 *	 * @throws Exception	 *             if the test fails	 */	public void testFixForBug2006() throws Exception {		try {			this.stmt.executeUpdate("DROP TABLE IF EXISTS testFixForBug2006_1");			this.stmt.executeUpdate("DROP TABLE IF EXISTS testFixForBug2006_2");			this.stmt					.executeUpdate("CREATE TABLE testFixForBug2006_1 (key_field INT NOT NULL)");			this.stmt					.executeUpdate("CREATE TABLE testFixForBug2006_2 (key_field INT NULL)");			this.stmt					.executeUpdate("INSERT INTO testFixForBug2006_1 VALUES (1)");			this.rs = this.stmt					.executeQuery("SELECT testFixForBug2006_1.key_field, testFixForBug2006_2.key_field FROM testFixForBug2006_1 LEFT JOIN testFixForBug2006_2 USING(key_field)");			ResultSetMetaData rsmd = this.rs.getMetaData();			assertTrue(rsmd.getColumnName(1).equals(rsmd.getColumnName(2)));			assertTrue(rsmd.isNullable(this.rs.findColumn("key_field")) == ResultSetMetaData.columnNoNulls);			assertTrue(rsmd.isNullable(2) == ResultSetMetaData.columnNullable);			assertTrue(this.rs.next());			assertTrue(this.rs.getObject(1) != null);			assertTrue(this.rs.getObject(2) == null);		} finally {			if (this.rs != null) {				try {					this.rs.close();				} catch (SQLException sqlEx) {					// ignore				}				this.rs = null;			}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美xxxxx牲另类人与| 亚洲一区视频在线| 91在线观看高清| 亚洲综合在线视频| 欧美老肥妇做.爰bbww视频| 午夜一区二区三区在线观看| 91麻豆精品国产综合久久久久久 | 中文字幕亚洲一区二区va在线| 成人av在线网站| 一区二区三区中文字幕精品精品 | 国产精品久久久久7777按摩 | 99精品欧美一区二区三区小说 | 日韩在线a电影| 精品三级在线看| 国产精品久久久久一区| 91视频.com| 日韩成人免费电影| 国产欧美一区二区三区在线看蜜臀 | 色综合天天性综合| 日韩精品免费专区| 久久久久久日产精品| 97久久超碰国产精品| 午夜精品一区在线观看| 精品处破学生在线二十三| 成人蜜臀av电影| 午夜精品久久久久影视| 久久蜜臀中文字幕| 色婷婷精品大在线视频| 理论电影国产精品| 1024成人网| 日韩欧美国产一区二区三区 | 色噜噜狠狠成人中文综合| 日本成人超碰在线观看| 欧美国产综合色视频| 欧美日本韩国一区| 粉嫩蜜臀av国产精品网站| 欧美日本韩国一区| 国产精品18久久久久久vr| 亚洲精品国产无套在线观| 欧美zozozo| 欧美在线一区二区| 国产成人精品综合在线观看| 亚洲第一综合色| 中文字幕精品在线不卡| 91精品一区二区三区在线观看| caoporen国产精品视频| 日韩中文字幕不卡| 亚洲婷婷国产精品电影人久久| 欧美大片拔萝卜| 色综合久久综合| 国产剧情在线观看一区二区| 亚洲r级在线视频| 中文字幕一区不卡| 久久夜色精品一区| 欧美日韩在线免费视频| 成人黄色在线视频| 精一区二区三区| 午夜a成v人精品| 亚洲免费观看在线视频| 国产欧美日韩精品a在线观看| 欧美精品色一区二区三区| 99久久婷婷国产综合精品电影| 免费成人美女在线观看| 亚洲综合无码一区二区| 国产精品另类一区| 精品成a人在线观看| 天堂va蜜桃一区二区三区| 国产精品美女久久久久久久网站| 日韩欧美一区二区视频| 欧美丝袜丝交足nylons图片| 成人av免费观看| 国产乱子轮精品视频| 视频一区二区欧美| 亚洲一区二区欧美| 国产精品久久久久影院色老大| 久久在线观看免费| 日韩亚洲欧美综合| 欧美精品一级二级| 欧美日韩一区中文字幕| 色综合中文字幕| 99re视频精品| 成人av影视在线观看| 国产精品一区二区久久不卡 | 国产精品色在线| www成人在线观看| 日韩欧美国产成人一区二区| 6080yy午夜一二三区久久| 91豆麻精品91久久久久久| 91小视频免费观看| 成人av电影观看| 成人一级视频在线观看| 国产在线一区二区| 伦理电影国产精品| 免费成人在线视频观看| 欧美一区二区三区免费观看视频 | 91精品国产综合久久福利| 在线观看亚洲一区| 在线视频国内自拍亚洲视频| 色综合亚洲欧洲| 91久久人澡人人添人人爽欧美| 99精品欧美一区二区蜜桃免费 | 日韩和欧美一区二区三区| 亚洲国产色一区| 亚洲国产综合在线| 亚洲国产日韩精品| 午夜精品福利一区二区蜜股av| 亚洲va欧美va国产va天堂影院| 午夜国产精品影院在线观看| 日韩成人dvd| 老司机免费视频一区二区三区| 久久99国产精品成人| 久久99九九99精品| 国产精品99久久久久久久女警| 国产福利一区二区三区视频| 国产91丝袜在线播放九色| 成人性色生活片免费看爆迷你毛片| 高清成人免费视频| 成人晚上爱看视频| 99精品久久99久久久久| 在线观看国产日韩| 欧美性欧美巨大黑白大战| 欧美日韩另类一区| 日韩欧美一区二区三区在线| 久久99精品一区二区三区| 国产精品综合二区| 成a人片亚洲日本久久| 色综合天天综合色综合av| 欧美性受极品xxxx喷水| 欧美精品1区2区3区| 欧美成人三级在线| 国产亚洲一本大道中文在线| 国产精品蜜臀av| 悠悠色在线精品| 日韩电影在线观看网站| 精品一区二区三区香蕉蜜桃 | 国产精品毛片久久久久久久| 亚洲视频1区2区| 午夜欧美电影在线观看| 麻豆精品久久久| 国产91清纯白嫩初高中在线观看| 一本一道久久a久久精品| 在线播放欧美女士性生活| 精品日韩在线一区| 久久久777精品电影网影网| 亚洲欧美一区二区在线观看| 性感美女久久精品| 韩国av一区二区| 色综合久久久久综合体| 欧美美女bb生活片| 久久你懂得1024| 亚洲激情图片qvod| 另类专区欧美蜜桃臀第一页| 久久精品国产精品亚洲综合| 成人app网站| 青娱乐精品视频| 国产精品资源在线观看| 亚洲国产wwwccc36天堂| 中文天堂在线一区| 久久久久久亚洲综合| 精品黑人一区二区三区久久 | 欧美性色黄大片| 成人的网站免费观看| 国产69精品久久777的优势| 久久99久久久欧美国产| 亚洲影院理伦片| 九色porny丨国产精品| 91视频在线看| 日韩一区二区三区电影在线观看| 国产精品久久久久久久久免费樱桃 | 国产v日产∨综合v精品视频| 在线免费观看日韩欧美| 日韩欧美色综合| 一区二区三区视频在线看| 久久国产精品99久久人人澡| 99riav久久精品riav| 日韩你懂的在线观看| 日韩毛片精品高清免费| 蜜臀av一区二区| 91传媒视频在线播放| 精品国产成人在线影院| 亚洲一区二区影院| 国产麻豆午夜三级精品| 欧美精品免费视频| 中文字幕一区二区5566日韩| 久久精品国产99| 欧美丝袜丝交足nylons| 国产精品免费av| 国产一区二三区| 在线综合视频播放| 亚洲黄色小视频| 成人av网站在线观看| 精品成人一区二区三区四区| 亚洲免费av网站| 国产成人在线色| 精品国产制服丝袜高跟| 亚洲成av人片一区二区三区| 97久久超碰国产精品电影| 国产网站一区二区| 韩国视频一区二区| 欧美一区午夜视频在线观看|