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

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

?? metadatatest.java

?? mysql jdbc驅動程序 mysql jdbc驅動程序 mysql jdbc驅動程序 mysql jdbc驅動程序
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* 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 java.sql.Connection;import java.sql.DatabaseMetaData;import java.sql.ResultSet;import java.sql.ResultSetMetaData;import java.sql.SQLException;import java.sql.Statement;import java.sql.Types;import java.util.HashSet;import java.util.List;import java.util.Properties;import java.util.Set;import com.mysql.jdbc.StringUtils;import testsuite.BaseTestCase;/** * Tests DatabaseMetaData methods. *  * @author Mark Matthews * @version $Id: MetadataTest.java 5828 2006-10-05 16:51:31Z mmatthews $ */public class MetadataTest extends BaseTestCase {	// ~ Constructors	// -----------------------------------------------------------	/**	 * Creates a new MetadataTest object.	 * 	 * @param name	 *            DOCUMENT ME!	 */	public MetadataTest(String name) {		super(name);	}	// ~ Methods	// ----------------------------------------------------------------	/**	 * Runs all test cases in this test suite	 * 	 * @param args	 */	public static void main(String[] args) {		junit.textui.TestRunner.run(MetadataTest.class);	}	/**	 * DOCUMENT ME!	 * 	 * @throws Exception	 *             DOCUMENT ME!	 */	public void setUp() throws Exception {		super.setUp();		createTestTable();	}	/**	 * DOCUMENT ME!	 * 	 * @throws SQLException	 *             DOCUMENT ME!	 */	public void testForeignKeys() throws SQLException {		try {			DatabaseMetaData dbmd = this.conn.getMetaData();			this.rs = dbmd.getImportedKeys(null, null, "child");			while (this.rs.next()) {				String pkColumnName = this.rs.getString("PKCOLUMN_NAME");				String fkColumnName = this.rs.getString("FKCOLUMN_NAME");				assertTrue("Primary Key not returned correctly ('"						+ pkColumnName + "' != 'parent_id')", pkColumnName						.equalsIgnoreCase("parent_id"));				assertTrue("Foreign Key not returned correctly ('"						+ fkColumnName + "' != 'parent_id_fk')", fkColumnName						.equalsIgnoreCase("parent_id_fk"));			}			this.rs.close();			this.rs = dbmd.getExportedKeys(null, null, "parent");			while (this.rs.next()) {				String pkColumnName = this.rs.getString("PKCOLUMN_NAME");				String fkColumnName = this.rs.getString("FKCOLUMN_NAME");				String fkTableName = this.rs.getString("FKTABLE_NAME");				assertTrue("Primary Key not returned correctly ('"						+ pkColumnName + "' != 'parent_id')", pkColumnName						.equalsIgnoreCase("parent_id"));				assertTrue(						"Foreign Key table not returned correctly for getExportedKeys ('"								+ fkTableName + "' != 'child')", fkTableName								.equalsIgnoreCase("child"));				assertTrue(						"Foreign Key not returned correctly for getExportedKeys ('"								+ fkColumnName + "' != 'parent_id_fk')",						fkColumnName.equalsIgnoreCase("parent_id_fk"));			}			this.rs.close();			this.rs = dbmd.getCrossReference(null, null, "cpd_foreign_3", null,					null, "cpd_foreign_4");			assertTrue(this.rs.next());			String pkColumnName = this.rs.getString("PKCOLUMN_NAME");			String pkTableName = this.rs.getString("PKTABLE_NAME");			String fkColumnName = this.rs.getString("FKCOLUMN_NAME");			String fkTableName = this.rs.getString("FKTABLE_NAME");			String deleteAction = cascadeOptionToString(this.rs					.getInt("DELETE_RULE"));			String updateAction = cascadeOptionToString(this.rs					.getInt("UPDATE_RULE"));			assertEquals(pkColumnName, "cpd_foreign_1_id");			assertEquals(pkTableName, "cpd_foreign_3");			assertEquals(fkColumnName, "cpd_foreign_1_id");			assertEquals(fkTableName, "cpd_foreign_4");			assertEquals(deleteAction, "NO ACTION");			assertEquals(updateAction, "CASCADE");			this.rs.close();			this.rs = null;		} finally {			if (this.rs != null) {				this.rs.close();				this.rs = null;			}		}	}	/**	 * DOCUMENT ME!	 * 	 * @throws SQLException	 *             DOCUMENT ME!	 */	public void testGetPrimaryKeys() throws SQLException {		try {			DatabaseMetaData dbmd = this.conn.getMetaData();			this.rs = dbmd.getPrimaryKeys(this.conn.getCatalog(), "",					"multikey");			short[] keySeqs = new short[4];			String[] columnNames = new String[4];			int i = 0;			while (this.rs.next()) {				this.rs.getString("TABLE_NAME");				columnNames[i] = this.rs.getString("COLUMN_NAME");				this.rs.getString("PK_NAME");				keySeqs[i] = this.rs.getShort("KEY_SEQ");				i++;			}			if ((keySeqs[0] != 3) && (keySeqs[1] != 2) && (keySeqs[2] != 4)					&& (keySeqs[4] != 1)) {				fail("Keys returned in wrong order");			}		} finally {			if (this.rs != null) {				try {					this.rs.close();				} catch (SQLException sqlEx) {					/* ignore */				}			}		}	}	private static String cascadeOptionToString(int option) {		switch (option) {		case DatabaseMetaData.importedKeyCascade:			return "CASCADE";		case DatabaseMetaData.importedKeySetNull:			return "SET NULL";		case DatabaseMetaData.importedKeyRestrict:			return "RESTRICT";		case DatabaseMetaData.importedKeyNoAction:			return "NO ACTION";		}		return "SET DEFAULT";	}	private void createTestTable() throws SQLException {		this.stmt.executeUpdate("DROP TABLE IF EXISTS child");		this.stmt.executeUpdate("DROP TABLE IF EXISTS parent");		this.stmt.executeUpdate("DROP TABLE IF EXISTS multikey");		this.stmt.executeUpdate("DROP TABLE IF EXISTS cpd_foreign_4");		this.stmt.executeUpdate("DROP TABLE IF EXISTS cpd_foreign_3");		this.stmt.executeUpdate("DROP TABLE IF EXISTS cpd_foreign_2");		this.stmt.executeUpdate("DROP TABLE IF EXISTS cpd_foreign_1");		this.stmt.executeUpdate("DROP TABLE IF EXISTS fktable2");		this.stmt.executeUpdate("DROP TABLE IF EXISTS fktable1");		this.stmt				.executeUpdate("CREATE TABLE parent(parent_id INT NOT NULL, PRIMARY KEY (parent_id)) TYPE=INNODB");		this.stmt				.executeUpdate("CREATE TABLE child(child_id INT, parent_id_fk INT, INDEX par_ind (parent_id_fk), "						+ "FOREIGN KEY (parent_id_fk) REFERENCES parent(parent_id)) TYPE=INNODB");		this.stmt				.executeUpdate("CREATE TABLE multikey(d INT NOT NULL, b INT NOT NULL, a INT NOT NULL, c INT NOT NULL, PRIMARY KEY (d, b, a, c))");		// Test compound foreign keys		this.stmt.executeUpdate("create table cpd_foreign_1("				+ "id int(8) not null auto_increment primary key,"				+ "name varchar(255) not null unique," + "key (id)"				+ ") type=InnoDB");		this.stmt.executeUpdate("create table cpd_foreign_2("				+ "id int(8) not null auto_increment primary key,"				+ "key (id)," + "name varchar(255)" + ") type=InnoDB");		this.stmt				.executeUpdate("create table cpd_foreign_3("						+ "cpd_foreign_1_id int(8) not null,"						+ "cpd_foreign_2_id int(8) not null,"						+ "key(cpd_foreign_1_id),"						+ "key(cpd_foreign_2_id),"						+ "primary key (cpd_foreign_1_id, cpd_foreign_2_id),"						+ "foreign key (cpd_foreign_1_id) references cpd_foreign_1(id),"						+ "foreign key (cpd_foreign_2_id) references cpd_foreign_2(id)"						+ ") type=InnoDB");		this.stmt				.executeUpdate("create table cpd_foreign_4("						+ "cpd_foreign_1_id int(8) not null,"						+ "cpd_foreign_2_id int(8) not null,"						+ "key(cpd_foreign_1_id),"						+ "key(cpd_foreign_2_id),"						+ "primary key (cpd_foreign_1_id, cpd_foreign_2_id),"						+ "foreign key (cpd_foreign_1_id, cpd_foreign_2_id) "						+ "references cpd_foreign_3(cpd_foreign_1_id, cpd_foreign_2_id) "						+ "ON DELETE RESTRICT ON UPDATE CASCADE"						+ ") type=InnoDB");		this.stmt				.executeUpdate("create table fktable1 (TYPE_ID int not null, TYPE_DESC varchar(32), primary key(TYPE_ID)) TYPE=InnoDB");		this.stmt				.executeUpdate("create table fktable2 (KEY_ID int not null, COF_NAME varchar(32), PRICE float, TYPE_ID int, primary key(KEY_ID), "						+ "index(TYPE_ID), foreign key(TYPE_ID) references fktable1(TYPE_ID)) TYPE=InnoDB");	}	/**	 * Tests the implementation of metadata for views.	 * 	 * This test automatically detects whether or not the server it is running	 * against supports the creation of views.	 * 	 * @throws SQLException	 *             if the test fails.	 */	public void testViewMetaData() throws SQLException {		try {			this.rs = this.conn.getMetaData().getTableTypes();			while (this.rs.next()) {				if ("VIEW".equalsIgnoreCase(this.rs.getString(1))) {					this.stmt							.executeUpdate("DROP VIEW IF EXISTS vTestViewMetaData");					this.stmt							.executeUpdate("DROP TABLE IF EXISTS testViewMetaData");					this.stmt							.executeUpdate("CREATE TABLE testViewMetaData (field1 INT)");					this.stmt							.executeUpdate("CREATE VIEW vTestViewMetaData AS SELECT field1 FROM testViewMetaData");					ResultSet tablesRs = null;					try {						tablesRs = this.conn.getMetaData().getTables(								this.conn.getCatalog(), null, "%ViewMetaData",								new String[] { "TABLE", "VIEW" });						assertTrue(tablesRs.next());						assertTrue("testViewMetaData".equalsIgnoreCase(tablesRs								.getString(3)));						assertTrue(tablesRs.next());						assertTrue("vTestViewMetaData"								.equalsIgnoreCase(tablesRs.getString(3)));					} finally {						if (tablesRs != null) {							tablesRs.close();						}					}					try {						tablesRs = this.conn.getMetaData().getTables(								this.conn.getCatalog(), null, "%ViewMetaData",								new String[] { "TABLE" });						assertTrue(tablesRs.next());						assertTrue("testViewMetaData".equalsIgnoreCase(tablesRs								.getString(3)));						assertTrue(!tablesRs.next());					} finally {						if (tablesRs != null) {							tablesRs.close();						}					}					break;				}			}		} finally {			if (this.rs != null) {				this.rs.close();			}		}	}	/**	 * Tests detection of read-only fields when the server is 4.1.0 or newer.	 * 	 * @throws Exception	 *             if the test fails.	 */	public void testRSMDIsReadOnly() throws Exception {		try {			this.rs = this.stmt.executeQuery("SELECT 1");			ResultSetMetaData rsmd = this.rs.getMetaData();			if (versionMeetsMinimum(4, 1)) {				assertTrue(rsmd.isReadOnly(1));				try {					this.stmt							.executeUpdate("DROP TABLE IF EXISTS testRSMDIsReadOnly");					this.stmt							.executeUpdate("CREATE TABLE testRSMDIsReadOnly (field1 INT)");					this.stmt							.executeUpdate("INSERT INTO testRSMDIsReadOnly VALUES (1)");					this.rs = this.stmt							.executeQuery("SELECT 1, field1 + 1, field1 FROM testRSMDIsReadOnly");					rsmd = this.rs.getMetaData();					assertTrue(rsmd.isReadOnly(1));					assertTrue(rsmd.isReadOnly(2));					assertTrue(!rsmd.isReadOnly(3));				} finally {					this.stmt							.executeUpdate("DROP TABLE IF EXISTS testRSMDIsReadOnly");				}			} else {				assertTrue(rsmd.isReadOnly(1) == false);			}		} finally {			if (this.rs != null) {				this.rs.close();			}		}	}	public void testBitType() throws Exception {		if (versionMeetsMinimum(5, 0, 3)) {			try {				this.stmt.executeUpdate("DROP TABLE IF EXISTS testBitType");				this.stmt						.executeUpdate("CREATE TABLE testBitType (field1 BIT, field2 BIT, field3 BIT)");				this.stmt						.executeUpdate("INSERT INTO testBitType VALUES (1, 0, NULL)");				this.rs = this.stmt						.executeQuery("SELECT field1, field2, field3 FROM testBitType");				this.rs.next();				assertTrue(((Boolean) this.rs.getObject(1)).booleanValue());				assertTrue(!((Boolean) this.rs.getObject(2)).booleanValue());				assertEquals(this.rs.getObject(3), null);				System.out.println(this.rs.getObject(1) + ", "						+ this.rs.getObject(2) + ", " + this.rs.getObject(3));				this.rs = this.conn.prepareStatement(						"SELECT field1, field2, field3 FROM testBitType")						.executeQuery();				this.rs.next();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区波多野结衣在线观看| 精品免费日韩av| 精品88久久久久88久久久| 亚洲精品视频在线观看网站| 精品一区二区在线视频| 91论坛在线播放| 国产日韩综合av| 美女久久久精品| 欧美日韩你懂得| 中文字幕佐山爱一区二区免费| 韩国v欧美v日本v亚洲v| 欧美精品乱码久久久久久按摩| 综合色中文字幕| 岛国精品在线播放| 久久免费电影网| 美女网站视频久久| 欧美三级欧美一级| 樱花影视一区二区| 99久久精品一区二区| 久久这里只有精品首页| 免费观看日韩av| 在线播放欧美女士性生活| 玉米视频成人免费看| 国产·精品毛片| 久久色在线观看| 精品夜夜嗨av一区二区三区| 欧美美女直播网站| 亚洲成人免费av| 欧美三级在线看| 亚洲午夜一区二区| 色成人在线视频| 亚洲视频电影在线| 91最新地址在线播放| 国产精品不卡在线| 成人激情免费电影网址| 国产欧美一区二区精品久导航 | 亚洲免费色视频| 99久久综合色| 中文字幕在线不卡国产视频| 欧美精品一区二区三区在线播放| 美国十次了思思久久精品导航| 91精品欧美一区二区三区综合在| 日韩精品一二三四| 91精品在线免费| 久久激情五月婷婷| 久久综合资源网| 国产精品18久久久久久久久久久久| 精品久久久久久无| 国产一区二区三区四| 久久久久久亚洲综合| 国产精品主播直播| 国产日韩欧美精品在线| 国产河南妇女毛片精品久久久 | 在线观看视频一区| 夜夜操天天操亚洲| 制服丝袜国产精品| 美女高潮久久久| 久久精品视频在线看| 成人自拍视频在线| 亚洲另类在线制服丝袜| 欧美日韩精品免费| 蜜臀久久久久久久| 久久精品一区四区| 99久久婷婷国产综合精品| 一区二区三区四区乱视频| 欧美精品一卡两卡| 国产在线观看一区二区| 欧美国产禁国产网站cc| 91小视频免费看| 午夜日韩在线电影| 欧美tickling网站挠脚心| 成人性生交大片| 一区二区三区在线高清| 91精品婷婷国产综合久久性色| 国产一区二区三区四区在线观看| 丁香五精品蜜臀久久久久99网站| 国产精品久久久久一区二区三区 | 国产麻豆视频一区| 1024成人网| 8x福利精品第一导航| 国内精品国产成人国产三级粉色| 国产精品久久久久久户外露出| 欧美日韩精品久久久| 激情都市一区二区| 樱桃视频在线观看一区| 精品少妇一区二区三区在线播放| www.日韩大片| 日韩国产欧美视频| 国产精品日韩精品欧美在线| 欧美午夜一区二区三区| 精品一区二区三区av| 亚洲精品第一国产综合野| 欧美一卡在线观看| 91原创在线视频| 美女脱光内衣内裤视频久久网站 | 亚洲欧洲精品一区二区三区 | 色综合久久久久综合| 日av在线不卡| 亚洲免费观看在线视频| 日韩美女在线视频| 91久久精品一区二区三区| 激情成人午夜视频| 亚洲午夜在线观看视频在线| 国产欧美一区二区精品秋霞影院| 欧美写真视频网站| 成人视屏免费看| 日韩激情一二三区| 日韩伦理av电影| 精品动漫一区二区三区在线观看| 色呦呦国产精品| 国产aⅴ精品一区二区三区色成熟| 亚洲成人自拍一区| k8久久久一区二区三区| 日本vs亚洲vs韩国一区三区二区 | 亚洲欧美国产高清| 久久精品视频一区| 欧美一级欧美三级| 在线视频欧美精品| 国产成人综合网站| 免费看欧美美女黄的网站| 亚洲你懂的在线视频| 国产亚洲成年网址在线观看| 欧美精品1区2区3区| 94-欧美-setu| 不卡区在线中文字幕| 韩国av一区二区| 日韩国产欧美在线观看| 亚洲国产你懂的| 亚洲美女一区二区三区| 国产欧美日韩在线| 久久久天堂av| 欧美电影免费观看高清完整版在 | 91精品国产aⅴ一区二区| 色综合天天综合网天天看片| 国产馆精品极品| 国产乱一区二区| 紧缚捆绑精品一区二区| 日日骚欧美日韩| 亚洲午夜精品在线| 亚洲色图欧洲色图婷婷| 国产精品视频观看| 久久久电影一区二区三区| 91精品国产91久久久久久最新毛片| 在线一区二区视频| 夜夜嗨av一区二区三区网页| 亚洲欧洲性图库| 国产精品丝袜在线| 中文字幕免费不卡| 国产亚洲综合性久久久影院| 日韩欧美不卡在线观看视频| 欧美一个色资源| 91精品国产入口| 欧美一区二区三区四区久久| 正在播放亚洲一区| 91精品福利在线一区二区三区| 欧美精品第1页| 欧美一区二区视频在线观看2022| 欧美剧情电影在线观看完整版免费励志电影 | 国产精品一二三区在线| 韩国精品在线观看| 国产精品一二三四区| 国产精品996| av高清久久久| 色婷婷国产精品久久包臀| 色久优优欧美色久优优| 在线观看一区二区精品视频| 欧美午夜电影一区| 777午夜精品免费视频| 日韩欧美中文字幕精品| 久久综合久久鬼色中文字| 久久精品欧美一区二区三区不卡| 国产欧美一区二区三区鸳鸯浴 | 亚洲国产电影在线观看| 综合久久给合久久狠狠狠97色 | 久久久久久夜精品精品免费| 欧美国产在线观看| 国产精品区一区二区三| 中文在线一区二区| 亚洲人精品一区| 亚洲第四色夜色| 另类小说欧美激情| 国产露脸91国语对白| www.欧美日韩国产在线| 欧美丝袜自拍制服另类| 日韩影院精彩在线| 免费成人你懂的| 国产69精品久久99不卡| 91香蕉视频黄| 91麻豆精品国产91久久久久久| 欧美成人a视频| 中文av一区特黄| 亚洲五月六月丁香激情| 麻豆91免费看| eeuss鲁片一区二区三区| 欧美中文字幕一区二区三区| 精品少妇一区二区| 中文字幕一区二区三区不卡在线| 亚洲国产精品一区二区久久| 久久成人免费网站| 成人精品国产免费网站|