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

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

?? updatabilitytest.java

?? 開發MySql數據庫的最新JDBC驅動。
?? JAVA
字號:
/* Copyright (C) 2002-2004 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.simple;import com.mysql.jdbc.NotUpdatable;import testsuite.BaseTestCase;import java.sql.DatabaseMetaData;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;/** * Tests for updatable result sets *  * @author Mark Matthews * @version $Id: UpdatabilityTest.java,v 1.1.2.1 2005/05/13 18:58:37 mmatthews *          Exp $ */public class UpdatabilityTest extends BaseTestCase {	/**	 * Creates a new UpdatabilityTest object.	 * 	 * @param name	 *            DOCUMENT ME!	 */	public UpdatabilityTest(String name) {		super(name);	}	/**	 * Runs all test cases in this test suite	 * 	 * @param args	 */	public static void main(String[] args) {		junit.textui.TestRunner.run(UpdatabilityTest.class);	}	/**	 * DOCUMENT ME!	 * 	 * @throws Exception	 *             DOCUMENT ME!	 */	public void setUp() throws Exception {		super.setUp();		createTestTable();	}	/**	 * If using MySQL-4.1, tests if aliased tables work as updatable result	 * sets.	 * 	 * @throws Exception	 *             if an error occurs	 */	public void testAliasedTables() throws Exception {		DatabaseMetaData dbmd = this.conn.getMetaData();		if (versionMeetsMinimum(4, 1)) {			Statement scrollableStmt = null;			try {				scrollableStmt = this.conn.createStatement(						ResultSet.TYPE_SCROLL_INSENSITIVE,						ResultSet.CONCUR_UPDATABLE);				this.rs = scrollableStmt						.executeQuery("SELECT pos1 AS p1, pos2 AS P2, char_field AS cf FROM UPDATABLE AS UPD LIMIT 1");				this.rs.next();				this.rs.close();				this.rs = null;				scrollableStmt.close();				scrollableStmt = null;			} finally {				if (this.rs != null) {					try {						this.rs.close();					} catch (SQLException sqlEx) {						; // ignore					}					this.rs = null;				}				if (scrollableStmt != null) {					try {						scrollableStmt.close();					} catch (SQLException sqlEx) {						; // ignore					}					scrollableStmt = null;				}			}		}	}	/**	 * Tests that the driver does not let you update result sets that come from	 * tables that don't have primary keys	 * 	 * @throws SQLException	 *             if an error occurs	 */	public void testBogusTable() throws SQLException {		this.stmt.executeUpdate("DROP TABLE IF EXISTS BOGUS_UPDATABLE");		this.stmt.executeUpdate("CREATE TABLE BOGUS_UPDATABLE (field1 int)");		Statement scrollableStmt = null;		try {			scrollableStmt = this.conn.createStatement(					ResultSet.TYPE_SCROLL_INSENSITIVE,					ResultSet.CONCUR_UPDATABLE);			this.rs = scrollableStmt					.executeQuery("SELECT * FROM BOGUS_UPDATABLE");			try {				this.rs.moveToInsertRow();				fail("ResultSet.moveToInsertRow() should not succeed on non-updatable table");			} catch (NotUpdatable noUpdate) {				// ignore			}		} finally {			if (scrollableStmt != null) {				try {					scrollableStmt.close();				} catch (SQLException sqlEx) {					;				}			}			this.stmt.executeUpdate("DROP TABLE IF EXISTS BOGUS_UPDATABLE");		}	}	/**	 * Tests that the driver does not let you update result sets that come from	 * queries that haven't selected all primary keys	 * 	 * @throws SQLException	 *             if an error occurs	 */	public void testMultiKeyTable() throws SQLException {		this.stmt.executeUpdate("DROP TABLE IF EXISTS MULTI_UPDATABLE");		this.stmt				.executeUpdate("CREATE TABLE MULTI_UPDATABLE (field1 int NOT NULL, field2 int NOT NULL, PRIMARY KEY (field1, field2))");		Statement scrollableStmt = null;		try {			scrollableStmt = this.conn.createStatement(					ResultSet.TYPE_SCROLL_INSENSITIVE,					ResultSet.CONCUR_UPDATABLE);			this.rs = scrollableStmt					.executeQuery("SELECT field1 FROM MULTI_UPDATABLE");			try {				this.rs.moveToInsertRow();				fail("ResultSet.moveToInsertRow() should not succeed on query that does not select all primary keys");			} catch (NotUpdatable noUpdate) {				// ignore			}		} finally {			if (scrollableStmt != null) {				try {					scrollableStmt.close();				} catch (SQLException sqlEx) {					// ignore				}			}			this.stmt.executeUpdate("DROP TABLE IF EXISTS MULTI_UPDATABLE");		}	}	/**	 * DOCUMENT ME!	 * 	 * @throws SQLException	 *             DOCUMENT ME!	 */	public void testUpdatability() throws SQLException {		Statement scrollableStmt = null;		try {			scrollableStmt = this.conn.createStatement(					ResultSet.TYPE_SCROLL_INSENSITIVE,					ResultSet.CONCUR_UPDATABLE);			this.rs = scrollableStmt					.executeQuery("SELECT * FROM UPDATABLE ORDER BY pos1");			this.rs.getMetaData().getColumnCount();			while (this.rs.next()) {				int rowPos = this.rs.getInt(1);				this.rs.updateString(3, "New Data" + (100 - rowPos));				this.rs.updateRow();			}			//			// Insert a new row			//			this.rs.moveToInsertRow();			this.rs.updateInt(1, 400);			this.rs.updateInt(2, 400);			this.rs.updateString(3, "New Data" + (100 - 400));			this.rs.insertRow();			// Test moveToCurrentRow			int rememberedPosition = this.rs.getRow();			this.rs.moveToInsertRow();			this.rs.moveToCurrentRow();			assertTrue("ResultSet.moveToCurrentRow() failed",					this.rs.getRow() == rememberedPosition);			this.rs.close();			this.rs = scrollableStmt					.executeQuery("SELECT * FROM UPDATABLE ORDER BY pos1");			boolean dataGood = true;			while (this.rs.next()) {				int rowPos = this.rs.getInt(1);				if (!this.rs.getString(3).equals("New Data" + (100 - rowPos))) {					dataGood = false;				}			}			assertTrue("Updates failed", dataGood);			// move back, and change the primary key			// This should work			int newPrimaryKeyId = 99999;			this.rs.absolute(1);			this.rs.updateInt(1, newPrimaryKeyId);			this.rs.updateRow();			int savedPrimaryKeyId = this.rs.getInt(1);			assertTrue("Updated primary key does not match",					(newPrimaryKeyId == savedPrimaryKeyId));			// Check cancelRowUpdates()			this.rs.absolute(1);			int primaryKey = this.rs.getInt(1);			int originalValue = this.rs.getInt(2);			this.rs.updateInt(2, -3);			this.rs.cancelRowUpdates();			int newValue = this.rs.getInt(2);			assertTrue("ResultSet.cancelRowUpdates() failed",					newValue == originalValue);			// Now check refreshRow()			// Check cancelRowUpdates()			this.rs.absolute(1);			primaryKey = this.rs.getInt(1);			this.stmt					.executeUpdate("UPDATE UPDATABLE SET char_field='foo' WHERE pos1="							+ primaryKey);			this.rs.refreshRow();			assertTrue("ResultSet.refreshRow failed", this.rs.getString(					"char_field").equals("foo"));			// Now check deleteRow()			this.rs.last();			int oldLastRow = this.rs.getRow();			this.rs.deleteRow();			this.rs.last();			assertTrue("ResultSet.deleteRow() failed",					this.rs.getRow() == (oldLastRow - 1));			this.rs.close();			/*			 * FIXME: Move to regression			 * 			 * scrollableStmt.executeUpdate("DROP TABLE IF EXISTS test");			 * scrollableStmt.executeUpdate("CREATE TABLE test (ident INTEGER			 * PRIMARY KEY, name TINYTEXT, expiry DATETIME default null)");			 * scrollableStmt.executeUpdate("INSERT INTO test SET ident=1,			 * name='original'");			 * 			 * //Select to get a resultset to work on ResultSet this.rs =			 * this.stmt.executeQuery("SELECT ident, name, expiry FROM test");			 * 			 * //Check that the expiry field was null before we did our update			 * this.rs.first();			 * 			 * java.sql.Date before = this.rs.getDate("expiry");			 * 			 * if (this.rs.wasNull()) { System.out.println("Expiry was correctly			 * SQL null before update"); }			 * 			 * //Update a different field this.rs.updateString("name",			 * "Updated"); this.rs.updateRow();			 * 			 * //Test to see if field has been altered java.sql.Date after =			 * this.rs.getDate(3);			 * 			 * if (this.rs.wasNull()) System.out.println("Bug disproved - expiry			 * SQL null after update"); else System.out.println("Bug proved -			 * expiry corrupted to '" + after + "'");			 */		} finally {			if (scrollableStmt != null) {				try {					scrollableStmt.close();				} catch (SQLException sqlEx) {					;				}			}		}	}	private void createTestTable() throws SQLException {		//		// Catch the error, the table might exist		//		try {			this.stmt.executeUpdate("DROP TABLE UPDATABLE");		} catch (SQLException SQLE) {			;		}		this.stmt				.executeUpdate("CREATE TABLE UPDATABLE (pos1 int not null, pos2 int not null, char_field VARCHAR(32), PRIMARY KEY (pos1, pos2))");		for (int i = 0; i < 100; i++) {			this.stmt.executeUpdate("INSERT INTO UPDATABLE VALUES (" + i + ", "					+ i + ",'StringData" + i + "')");		}	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲超丰满肉感bbw| 日韩免费一区二区| 蜜桃精品视频在线观看| 国产精品丝袜久久久久久app| 国产999精品久久| 日韩电影网1区2区| 亚洲精品一卡二卡| 欧美精彩视频一区二区三区| 9191精品国产综合久久久久久| www.亚洲精品| 国产精品亚洲专一区二区三区| 夜色激情一区二区| 国产精品欧美久久久久无广告| 欧美精品久久一区| 色美美综合视频| 国产乱色国产精品免费视频| 青青草原综合久久大伊人精品优势| 亚洲色图欧美激情| 国产午夜亚洲精品午夜鲁丝片| 91精品国产手机| 欧美日本在线看| 在线欧美小视频| 成人精品一区二区三区四区| 麻豆精品在线观看| 日韩黄色免费电影| 亚洲国产成人tv| 亚洲一区二区三区四区不卡| **性色生活片久久毛片| 欧美极品美女视频| 久久男人中文字幕资源站| 欧美一区二区三区色| 视频一区在线播放| 亚洲高清久久久| 一区二区三区视频在线看| 国产精品国产自产拍高清av| 久久色视频免费观看| 欧美一区二区三区人| 欧美日韩国产大片| 欧美日韩成人一区二区| 色综合久久久久综合| 成人91在线观看| 成人高清在线视频| 成人黄页在线观看| 99久久婷婷国产精品综合| 成人一区二区在线观看| gogo大胆日本视频一区| 亚洲欧洲日韩在线| 亚洲欧美怡红院| 国产精品不卡在线| 日韩毛片高清在线播放| 一区二区三区在线看| 伊人一区二区三区| 亚洲成人手机在线| 麻豆成人久久精品二区三区红 | 亚洲欧美在线视频| 国产精品少妇自拍| 亚洲欧美日韩中文字幕一区二区三区| 久久老女人爱爱| 久久久午夜电影| 国产精品天天看| 亚洲免费观看高清完整版在线观看| 亚洲视频每日更新| 亚洲 欧美综合在线网络| 亚洲午夜国产一区99re久久| 亚洲国产一区二区a毛片| 亚洲午夜久久久久中文字幕久| 亚洲影院久久精品| 免费欧美在线视频| 国产综合成人久久大片91| 风间由美中文字幕在线看视频国产欧美| 国产99精品国产| 欧美四级电影网| 91精品国产色综合久久不卡电影 | 奇米亚洲午夜久久精品| 久草在线在线精品观看| 开心九九激情九九欧美日韩精美视频电影| 久久97超碰国产精品超碰| 成人午夜视频在线观看| 欧美日本一区二区三区四区| 久久免费美女视频| 亚洲小说欧美激情另类| 国模娜娜一区二区三区| 久久精品国产在热久久| 99久久久久久| 这里只有精品99re| 国产精品视频免费| 日韩成人一级片| 99久久久国产精品| 欧美不卡激情三级在线观看| 最新日韩在线视频| 久久精品99国产精品日本| 91在线精品一区二区| 精品国产一区二区三区久久久蜜月 | 国产成人av电影在线播放| 91黄色免费网站| 久久综合九色综合97_久久久| 亚洲欧美日韩综合aⅴ视频| 久久se精品一区精品二区| av不卡在线观看| 日韩欧美亚洲另类制服综合在线| 亚洲欧美色图小说| 高清在线成人网| 欧美大尺度电影在线| 亚洲国产成人va在线观看天堂| 成人污污视频在线观看| 日韩你懂的在线播放| 亚洲国产综合色| 色综合一区二区| 中文字幕免费观看一区| 精品一区二区三区日韩| 欧美日韩国产三级| 国产精品视频线看| 国产成人av在线影院| 精品久久久久久久久久久久包黑料| 国产精品伦一区二区三级视频| 日本欧洲一区二区| 欧美在线观看一区| 中文字幕视频一区二区三区久| 国产精品久久久久久久久果冻传媒 | 色婷婷综合视频在线观看| 国产午夜精品一区二区三区视频 | 精品国产髙清在线看国产毛片| 亚洲国产精品尤物yw在线观看| 99久久精品免费精品国产| 国产亚洲欧洲997久久综合| 乱一区二区av| 精品少妇一区二区三区日产乱码| 天涯成人国产亚洲精品一区av| 欧美亚洲国产一区二区三区| 亚洲欧美日韩在线| 色综合视频在线观看| 日韩一区在线播放| aaa欧美日韩| 中文字幕中文字幕在线一区| 成人免费高清在线| 国产精品福利一区| 99精品国产99久久久久久白柏| 成人免费一区二区三区视频 | 色婷婷综合激情| 亚洲男帅同性gay1069| 成人高清视频免费观看| 国产精品成人免费| 一本到不卡精品视频在线观看| 亚洲日本va午夜在线电影| 99麻豆久久久国产精品免费| 一色桃子久久精品亚洲| 91麻豆国产自产在线观看| 综合久久综合久久| 91行情网站电视在线观看高清版| 亚洲乱码中文字幕综合| 欧美私模裸体表演在线观看| 五月婷婷色综合| 日韩一级免费观看| 中文字幕欧美区| 成人手机电影网| 一区二区三区免费看视频| 欧美男男青年gay1069videost| 日产国产高清一区二区三区| 欧美videofree性高清杂交| 国产美女主播视频一区| 久久精品欧美一区二区三区不卡| 成人一道本在线| 亚洲一区二区精品3399| 日韩欧美亚洲国产另类| 国产精品一区免费在线观看| 国产精品理伦片| 国产精品美女久久久久aⅴ| 自拍偷在线精品自拍偷无码专区| 在线观看日韩高清av| 蜜臀av一区二区在线观看| 久久久久一区二区三区四区| 99在线精品视频| 亚洲狠狠爱一区二区三区| 久久综合久色欧美综合狠狠| 99久久精品国产毛片| 日韩精品成人一区二区三区 | 一区二区三区高清不卡| 日韩小视频在线观看专区| 成人免费看视频| 视频一区视频二区在线观看| 久久午夜电影网| 欧美久久久久久久久久| 国产91富婆露脸刺激对白| 亚洲一区二区欧美激情| 久久精品免视看| 久色婷婷小香蕉久久| 最新国产の精品合集bt伙计| 欧美一级在线观看| 91美女福利视频| 国产乱淫av一区二区三区| 日韩中文字幕麻豆| 国产精品美女久久久久av爽李琼| 欧美日韩国产天堂| 91免费观看国产| 国产精品一卡二| 日韩中文字幕区一区有砖一区| 国产精品美女一区二区| 日韩精品自拍偷拍| 欧美午夜电影在线播放| 成人app在线|