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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? metadatatest.java

?? 用于JAVA數(shù)據(jù)庫連接.解壓就可用,方便得很
?? 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();				assertTrue(((Boolean) this.rs.getObject(1)).booleanValue());				assertTrue(!((Boolean) this.rs.getObject(2)).booleanValue());				assertEquals(this.rs.getObject(3), null);				byte[] asBytesTrue = this.rs.getBytes(1);				byte[] asBytesFalse = this.rs.getBytes(2);				byte[] asBytesNull = this.rs.getBytes(3);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人黄色小视频在线观看| 91在线观看美女| 一卡二卡三卡日韩欧美| 国产亚洲精品aa| 亚洲精品一区二区三区精华液| 色av一区二区| 色呦呦日韩精品| 2017欧美狠狠色| 欧美日韩一区二区三区四区 | 黑人巨大精品欧美一区| 亚洲成人777| 午夜精品久久久久久| 亚洲午夜电影在线观看| 亚洲国产精品久久一线不卡| 亚洲韩国精品一区| 亚洲狠狠爱一区二区三区| 亚洲一区二区三区小说| 亚洲欧美激情插| 同产精品九九九| 久久精品二区亚洲w码| 国产综合成人久久大片91| 极品少妇一区二区| 高清在线不卡av| 91蜜桃婷婷狠狠久久综合9色| 99视频一区二区| 欧美日韩一区中文字幕| 欧美一级黄色录像| 中文天堂在线一区| 性感美女极品91精品| 麻豆精品视频在线观看| 国产精品一区免费在线观看| 91黄色免费看| 欧美电影精品一区二区| 亚洲同性gay激情无套| 青青国产91久久久久久| 9l国产精品久久久久麻豆| 制服丝袜成人动漫| 中文字幕日韩一区二区| 日韩精品每日更新| 99国产精品久久| 精品sm在线观看| 亚洲成a人片综合在线| 成人一区二区三区视频在线观看| 欧美三级中文字幕在线观看| 国产亚洲美州欧州综合国| 亚洲国产精品嫩草影院| 成人v精品蜜桃久久一区| 91麻豆精品国产自产在线| 亚洲色欲色欲www在线观看| 黄页视频在线91| 日韩一本二本av| 亚洲综合色成人| 91蝌蚪porny| 中文无字幕一区二区三区| 日本sm残虐另类| 欧美丝袜自拍制服另类| 亚洲欧美日韩国产手机在线| 粉嫩久久99精品久久久久久夜| 日韩精品一区在线观看| 图片区小说区国产精品视频| 色噜噜久久综合| 亚洲精品欧美激情| 日本韩国欧美一区二区三区| 亚洲三级在线播放| 91在线观看视频| 亚洲美女区一区| 欧美日韩一区二区三区高清| 一区二区三区精品视频在线| 欧美综合欧美视频| 亚洲电影中文字幕在线观看| 欧美日韩不卡在线| 免费成人av在线| 久久久国产午夜精品| 99久久综合国产精品| 亚洲影院久久精品| 日韩一级二级三级精品视频| 精品夜夜嗨av一区二区三区| 国产日产欧产精品推荐色| www.亚洲色图.com| 亚洲成人福利片| 2023国产精品自拍| 91片黄在线观看| 麻豆91在线观看| 国产精品美女久久久久久| 色狠狠综合天天综合综合| 日韩高清欧美激情| ...av二区三区久久精品| 欧美人体做爰大胆视频| 国内精品伊人久久久久av影院| 国产精品免费视频网站| 日韩写真欧美这视频| 成人sese在线| 久久国产精品无码网站| 亚洲国产视频在线| 久久婷婷国产综合精品青草 | 国产成人av一区二区| 亚洲图片有声小说| 日本一区二区三区久久久久久久久不 | 国产女人18水真多18精品一级做| 欧美va天堂va视频va在线| 中文字幕中文字幕中文字幕亚洲无线| 国产精品一区一区| 毛片不卡一区二区| 国产ts人妖一区二区| 成人av资源站| 欧美日韩三级一区| 91久久久免费一区二区| 国产不卡高清在线观看视频| 美女精品一区二区| 日韩av网站在线观看| 亚洲蜜臀av乱码久久精品| 国产欧美视频一区二区| 日韩欧美一区二区久久婷婷| 色成年激情久久综合| 97se亚洲国产综合自在线不卡| 国产中文字幕精品| 狠狠色丁香久久婷婷综合_中| 亚洲国产综合在线| 亚洲国产精品一区二区www| 亚洲激情男女视频| 亚洲在线观看免费| 国产成人亚洲综合a∨婷婷 | 精品国偷自产国产一区| 日韩一区二区三区在线观看| 精品国产一区二区三区不卡| www久久久久| 亚洲人成在线观看一区二区| ...xxx性欧美| 天堂蜜桃91精品| 狂野欧美性猛交blacked| 国产东北露脸精品视频| 99精品欧美一区二区蜜桃免费 | 99久久国产免费看| 欧美日韩一区不卡| 精品成人一区二区| 亚洲视频精选在线| 日韩精品亚洲专区| 国产91富婆露脸刺激对白| 欧美性大战久久| 久久久久久99久久久精品网站| 尤物在线观看一区| 国产成人免费高清| 精品久久一区二区| 亚洲美女屁股眼交| 中文字幕在线视频一区| 三级影片在线观看欧美日韩一区二区| 91亚洲永久精品| 亚洲一区二区三区视频在线播放 | 欧美午夜影院一区| 最新国产成人在线观看| 成人免费视频视频在线观看免费| 日韩视频免费观看高清完整版 | 欧美一级生活片| 亚洲资源中文字幕| 成人动漫中文字幕| 26uuu精品一区二区| 亚洲国产精品视频| 99久久99久久精品国产片果冻 | 亚洲欧洲99久久| 韩国三级在线一区| 精品免费国产二区三区| 久久99国产精品麻豆| 精品国产伦一区二区三区观看方式| 午夜久久久影院| 久久精品欧美日韩精品| 美女爽到高潮91| 久久久噜噜噜久久人人看| 成人精品一区二区三区四区| 欧美一区二区三区系列电影| 视频一区视频二区中文字幕| 欧美日韩在线观看一区二区| 蜜臀国产一区二区三区在线播放| 欧美性极品少妇| 日韩二区三区四区| 日韩久久久久久| 极品少妇一区二区| 国产精品美女久久久久aⅴ| 色综合久久综合网97色综合 | 免费看日韩a级影片| 日韩欧美国产综合一区| 国产盗摄女厕一区二区三区| 国产欧美一区二区三区鸳鸯浴| 国产成人av影院| 亚洲天堂av一区| 欧美精品丝袜中出| 国产在线播放一区| 最近日韩中文字幕| 欧美精品三级在线观看| 国产一区二区h| 一区二区高清视频在线观看| 国产日产欧美一区二区三区 | 久久久久久久av麻豆果冻| 欧美人妇做爰xxxⅹ性高电影| 高清不卡一区二区| 国产黄色成人av| 国产成人免费在线观看| 国产精品911| 国产一区二区导航在线播放| 久久国产精品露脸对白| 精品无人码麻豆乱码1区2区|