亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美aⅴ一区二区三区视频| 69堂亚洲精品首页| 日本在线不卡视频| 中文字幕亚洲成人| 国产精品热久久久久夜色精品三区 | 日韩欧美激情在线| 3d动漫精品啪啪| 在线不卡的av| 欧美中文字幕一区二区三区亚洲| av午夜一区麻豆| 91视频www| 色婷婷综合五月| 色哟哟在线观看一区二区三区| 91啪亚洲精品| 欧美天堂一区二区三区| 欧美日韩在线观看一区二区| 欧美久久久久久久久中文字幕| 欧美在线观看18| 欧美精品精品一区| 欧美大度的电影原声| 久久久久久久精| 亚洲欧洲一区二区在线播放| 亚洲精品美腿丝袜| 亚洲国产精品视频| 久久国产精品72免费观看| 成人福利在线看| 国产91高潮流白浆在线麻豆| 成人免费毛片aaaaa**| 91蝌蚪porny| 欧美三级电影在线看| 日韩欧美色电影| 国产精品三级电影| 天天做天天摸天天爽国产一区| 麻豆91在线看| 色综合中文字幕国产| 色综合欧美在线视频区| 91久久精品一区二区三区| 欧美久久久久久久久中文字幕| 337p日本欧洲亚洲大胆色噜噜| 国产精品对白交换视频 | 91麻豆精品国产91久久久久| 91超碰这里只有精品国产| 精品福利视频一区二区三区| 亚洲国产激情av| 婷婷六月综合网| 久久国产福利国产秒拍| www.一区二区| 日韩精品一区二区三区视频播放 | 精久久久久久久久久久| yourporn久久国产精品| 欧美精品久久一区| 国产精品全国免费观看高清 | 亚洲精品v日韩精品| 日本亚洲最大的色成网站www| 国产成人免费av在线| 欧美体内she精视频| 久久久777精品电影网影网| 亚洲男人的天堂在线aⅴ视频| 日本成人在线不卡视频| 成人国产精品免费观看动漫| 日韩欧美激情一区| 亚洲大型综合色站| 成人动漫av在线| 日韩一级成人av| 亚洲成a人v欧美综合天堂| 懂色中文一区二区在线播放| 欧美高清www午色夜在线视频| 亚洲欧洲一区二区在线播放| 国产一区二区0| 欧美一区二区三区日韩| 午夜欧美视频在线观看| 国产大陆a不卡| 久久影院午夜片一区| 日韩精品亚洲一区| 欧美午夜不卡视频| 亚洲成在线观看| 欧美在线免费播放| 亚洲男人天堂av| 高清beeg欧美| 久久蜜桃av一区精品变态类天堂| 国产一区二区三区电影在线观看| 成人爱爱电影网址| 日韩免费高清av| 日本一不卡视频| 欧美性色黄大片| 亚洲最大色网站| 五月天激情小说综合| 欧美性大战久久久久久久| 偷窥国产亚洲免费视频 | 依依成人精品视频| 欧美视频在线观看一区二区| 污片在线观看一区二区| 91精品欧美一区二区三区综合在| 精品一区二区精品| 久久精品人人做| 成人av影院在线| 亚洲一区成人在线| 538prom精品视频线放| 日韩国产一区二| 欧美精品一区在线观看| 成年人午夜久久久| 亚洲电影欧美电影有声小说| 日韩一区二区在线观看视频播放| 国产酒店精品激情| 亚洲免费观看视频| xvideos.蜜桃一区二区| 99精品黄色片免费大全| 亚洲一区自拍偷拍| 久久日一线二线三线suv| 99热99精品| 美女视频黄频大全不卡视频在线播放 | 一本一道久久a久久精品| 亚洲一级二级在线| 精品国产一区久久| 91官网在线观看| 韩国精品主播一区二区在线观看| 亚洲天堂网中文字| 精品国产91久久久久久久妲己| 一本色道久久综合亚洲精品按摩| 秋霞影院一区二区| 亚洲精品乱码久久久久久久久 | 狠狠色综合播放一区二区| 久久久亚洲高清| 欧美美女一区二区| 91欧美激情一区二区三区成人| 日韩va欧美va亚洲va久久| 亚洲视频一二区| 国产欧美在线观看一区| 欧美一级二级三级乱码| 99re这里只有精品首页| 国内精品免费**视频| 三级亚洲高清视频| 亚洲一区二区av电影| 亚洲欧美怡红院| 国产精品无人区| 久久精品人人做| 久久女同互慰一区二区三区| 337p亚洲精品色噜噜噜| 欧美日韩一区二区三区免费看 | 久久99最新地址| 天堂va蜜桃一区二区三区| 中文字幕日韩精品一区| 26uuu精品一区二区三区四区在线| 成人动漫视频在线| 风流少妇一区二区| 国产大片一区二区| 韩国理伦片一区二区三区在线播放| 日韩综合一区二区| 日韩在线a电影| 亚洲成人综合网站| 亚洲福利一区二区| 亚洲成人自拍一区| 一区二区三区久久| 亚洲欧美经典视频| 国产欧美日本一区视频| 亚洲国产激情av| 91.com视频| 在线播放国产精品二区一二区四区 | 久久久亚洲精品石原莉奈 | 91女厕偷拍女厕偷拍高清| 91在线视频播放地址| 色一情一伦一子一伦一区| 91麻豆国产福利精品| 欧美午夜电影网| 日韩欧美二区三区| 久久这里只有精品视频网| 欧美国产精品一区二区三区| 中文av一区二区| 亚洲综合一区二区三区| 亚洲第一福利一区| 久久se精品一区二区| 国产激情91久久精品导航| 成人国产精品视频| 欧美日韩一区高清| 欧美精品一区二区在线观看| 久久日韩粉嫩一区二区三区| 亚洲日本在线观看| 三级影片在线观看欧美日韩一区二区| 裸体健美xxxx欧美裸体表演| 国产成人免费xxxxxxxx| 在线观看av一区| 精品国产一区二区三区久久影院| 国产拍欧美日韩视频二区| 亚洲国产另类精品专区| 久久精品免费看| 97久久人人超碰| 欧美一卡在线观看| 中文字幕中文乱码欧美一区二区| 亚洲成av人片一区二区三区| 国产成人夜色高潮福利影视| 欧美主播一区二区三区| 精品va天堂亚洲国产| 亚洲人亚洲人成电影网站色| 日韩av午夜在线观看| 国产不卡免费视频| 欧美夫妻性生活| 亚洲激情在线播放| 韩国成人在线视频| 欧美日本一区二区| 亚洲日本护士毛茸茸|