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

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

?? statementstest.java

?? 用于JAVA數據庫連接.解壓就可用,方便得很
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/* 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.simple;import java.io.ByteArrayInputStream;import java.io.ByteArrayOutputStream;import java.io.CharArrayReader;import java.io.InputStream;import java.io.Reader;import java.io.StringReader;import java.math.BigDecimal;import java.rmi.server.UID;import java.sql.BatchUpdateException;import java.sql.CallableStatement;import java.sql.Connection;import java.sql.Date;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;import java.sql.Time;import java.sql.Timestamp;import java.sql.Types;import java.text.SimpleDateFormat;import java.util.Locale;import java.util.Properties;import testsuite.BaseTestCase;import com.mysql.jdbc.NotImplemented;import com.mysql.jdbc.ParameterBindings;import com.mysql.jdbc.SQLError;import com.mysql.jdbc.StatementImpl;import com.mysql.jdbc.StringUtils;/** * DOCUMENT ME! * * @author Mark Matthews * @version $Id: StatementsTest.java 4494 2005-10-31 22:30:34 -0600 (Mon, 31 Oct *          2005) mmatthews $ */public class StatementsTest extends BaseTestCase {	private static final int MAX_COLUMN_LENGTH = 255;	private static final int MAX_COLUMNS_TO_TEST = 40;	private static final int MIN_COLUMN_LENGTH = 10;	private static final int STEP = 8;	/**	 * Runs all test cases in this test suite	 *	 * @param args	 */	public static void main(String[] args) {		junit.textui.TestRunner.run(StatementsTest.class);	}	/**	 * Creates a new StatementsTest object.	 *	 * @param name	 *            DOCUMENT ME!	 */	public StatementsTest(String name) {		super(name);	}	/**	 * DOCUMENT ME!	 *	 * @throws Exception	 *             DOCUMENT ME!	 */	public void setUp() throws Exception {		super.setUp();		this.stmt.executeUpdate("DROP TABLE IF EXISTS statement_test");		this.stmt.executeUpdate("DROP TABLE IF EXISTS statement_batch_test");		this.stmt				.executeUpdate("CREATE TABLE statement_test (id int not null primary key auto_increment, strdata1 varchar(255) not null, strdata2 varchar(255))");		this.stmt.executeUpdate("CREATE TABLE statement_batch_test "				+ "(id int not null primary key auto_increment, "				+ "strdata1 varchar(255) not null, strdata2 varchar(255), "				+ "UNIQUE INDEX (strdata1))");		for (int i = 6; i < MAX_COLUMNS_TO_TEST; i += STEP) {			this.stmt.executeUpdate("DROP TABLE IF EXISTS statement_col_test_"					+ i);			StringBuffer insertBuf = new StringBuffer(					"INSERT INTO statement_col_test_");			StringBuffer stmtBuf = new StringBuffer(					"CREATE TABLE IF NOT EXISTS statement_col_test_");			stmtBuf.append(i);			insertBuf.append(i);			stmtBuf.append(" (");			insertBuf.append(" VALUES (");			boolean firstTime = true;			for (int j = 0; j < i; j++) {				if (!firstTime) {					stmtBuf.append(",");					insertBuf.append(",");				} else {					firstTime = false;				}				stmtBuf.append("col_");				stmtBuf.append(j);				stmtBuf.append(" VARCHAR(");				stmtBuf.append(MAX_COLUMN_LENGTH);				stmtBuf.append(")");				insertBuf.append("'");				int numChars = 16;				for (int k = 0; k < numChars; k++) {					insertBuf.append("A");				}				insertBuf.append("'");			}			stmtBuf.append(")");			insertBuf.append(")");			this.stmt.executeUpdate(stmtBuf.toString());			this.stmt.executeUpdate(insertBuf.toString());		}		// explicitly set the catalog to exercise code in execute(),		// executeQuery() and		// executeUpdate()		// FIXME: Only works on Windows!		// this.conn.setCatalog(this.conn.getCatalog().toUpperCase());	}	/**	 * DOCUMENT ME!	 *	 * @throws Exception	 *             DOCUMENT ME!	 */	public void tearDown() throws Exception {		this.stmt.executeUpdate("DROP TABLE statement_test");		for (int i = 0; i < MAX_COLUMNS_TO_TEST; i += STEP) {			StringBuffer stmtBuf = new StringBuffer(					"DROP TABLE IF EXISTS statement_col_test_");			stmtBuf.append(i);			this.stmt.executeUpdate(stmtBuf.toString());		}		try {			this.stmt.executeUpdate("DROP TABLE statement_batch_test");		} catch (SQLException sqlEx) {			;		}		super.tearDown();	}	/**	 * DOCUMENT ME!	 *	 * @throws SQLException	 *             DOCUMENT ME!	 */	public void testAccessorsAndMutators() throws SQLException {		assertTrue("Connection can not be null, and must be same connection",				this.stmt.getConnection() == this.conn);		// Set max rows, to exercise code in execute(), executeQuery() and		// executeUpdate()		Statement accessorStmt = null;		try {			accessorStmt = this.conn.createStatement();			accessorStmt.setMaxRows(1);			accessorStmt.setMaxRows(0); // FIXME, test that this actually			// affects rows returned			accessorStmt.setMaxFieldSize(255);			assertTrue("Max field size should match what was set", accessorStmt					.getMaxFieldSize() == 255);			try {				accessorStmt.setMaxFieldSize(Integer.MAX_VALUE);				fail("Should not be able to set max field size > max_packet_size");			} catch (SQLException sqlEx) {				;			}			accessorStmt.setCursorName("undef");			accessorStmt.setEscapeProcessing(true);			accessorStmt.setFetchDirection(java.sql.ResultSet.FETCH_FORWARD);			int fetchDirection = accessorStmt.getFetchDirection();			assertTrue("Set fetch direction != get fetch direction",					fetchDirection == java.sql.ResultSet.FETCH_FORWARD);			try {				accessorStmt.setFetchDirection(Integer.MAX_VALUE);				fail("Should not be able to set fetch direction to invalid value");			} catch (SQLException sqlEx) {				;			}			try {				accessorStmt.setMaxRows(50000000 + 10);				fail("Should not be able to set max rows > 50000000");			} catch (SQLException sqlEx) {				;			}			try {				accessorStmt.setMaxRows(Integer.MIN_VALUE);				fail("Should not be able to set max rows < 0");			} catch (SQLException sqlEx) {				;			}			int fetchSize = this.stmt.getFetchSize();			try {				accessorStmt.setMaxRows(4);				accessorStmt.setFetchSize(Integer.MAX_VALUE);				fail("Should not be able to set FetchSize > max rows");			} catch (SQLException sqlEx) {				;			}			try {				accessorStmt.setFetchSize(-2);				fail("Should not be able to set FetchSize < 0");			} catch (SQLException sqlEx) {				;			}			assertTrue(					"Fetch size before invalid setFetchSize() calls should match fetch size now",					fetchSize == this.stmt.getFetchSize());		} finally {			if (accessorStmt != null) {				try {					accessorStmt.close();				} catch (SQLException sqlEx) {					;				}				accessorStmt = null;			}		}	}	/**	 * DOCUMENT ME!	 *	 * @throws SQLException	 *             DOCUMENT ME!	 */	public void testAutoIncrement() throws SQLException {		if (!isRunningOnJdk131()) {			try {				this.stmt = this.conn.createStatement(						java.sql.ResultSet.TYPE_FORWARD_ONLY,						java.sql.ResultSet.CONCUR_READ_ONLY);				this.stmt.setFetchSize(Integer.MIN_VALUE);				this.stmt						.executeUpdate("INSERT INTO statement_test (strdata1) values ('blah')");				int autoIncKeyFromApi = -1;				this.rs = this.stmt.getGeneratedKeys();				if (this.rs.next()) {					autoIncKeyFromApi = this.rs.getInt(1);				} else {					fail("Failed to retrieve AUTO_INCREMENT using Statement.getGeneratedKeys()");				}				this.rs.close();				int autoIncKeyFromFunc = -1;				this.rs = this.stmt.executeQuery("SELECT LAST_INSERT_ID()");				if (this.rs.next()) {					autoIncKeyFromFunc = this.rs.getInt(1);				} else {					fail("Failed to retrieve AUTO_INCREMENT using LAST_INSERT_ID()");				}				if ((autoIncKeyFromApi != -1) && (autoIncKeyFromFunc != -1)) {					assertTrue(							"Key retrieved from API ("									+ autoIncKeyFromApi									+ ") does not match key retrieved from LAST_INSERT_ID() "									+ autoIncKeyFromFunc + ") function",							autoIncKeyFromApi == autoIncKeyFromFunc);				} else {					fail("AutoIncrement keys were '0'");				}			} finally {				if (this.rs != null) {					try {						this.rs.close();					} catch (Exception ex) { /* ignore */						;					}				}				this.rs = null;			}		}	}	/**	 * Tests all variants of numerical types (signed/unsigned) for correct	 * operation when used as return values from a prepared statement.	 *	 * @throws Exception	 */	public void testBinaryResultSetNumericTypes() throws Exception {		/*		 * TINYINT 1 -128 127 SMALLINT 2 -32768 32767 MEDIUMINT 3 -8388608		 * 8388607 INT 4 -2147483648 2147483647 BIGINT 8 -9223372036854775808		 * 9223372036854775807		 */		String unsignedMinimum = "0";		String tiMinimum = "-128";		String tiMaximum = "127";		String utiMaximum = "255";		String siMinimum = "-32768";		String siMaximum = "32767";		String usiMaximum = "65535";		String miMinimum = "-8388608";		String miMaximum = "8388607";		String umiMaximum = "16777215";		String iMinimum = "-2147483648";		String iMaximum = "2147483647";		String uiMaximum = "4294967295";		String biMinimum = "-9223372036854775808";		String biMaximum = "9223372036854775807";		String ubiMaximum = "18446744073709551615";		try {			this.stmt					.executeUpdate("DROP TABLE IF EXISTS testBinaryResultSetNumericTypes");			this.stmt					.executeUpdate("CREATE TABLE testBinaryResultSetNumericTypes(rowOrder TINYINT, ti TINYINT,"							+ "uti TINYINT UNSIGNED, si SMALLINT,"							+ "usi SMALLINT UNSIGNED, mi MEDIUMINT,"							+ "umi MEDIUMINT UNSIGNED, i INT, ui INT UNSIGNED,"							+ "bi BIGINT, ubi BIGINT UNSIGNED)");			PreparedStatement inserter = this.conn					.prepareStatement("INSERT INTO testBinaryResultSetNumericTypes VALUES (?,?,?,?,?,?,?,?,?,?,?)");			inserter.setInt(1, 0);			inserter.setString(2, tiMinimum);			inserter.setString(3, unsignedMinimum);			inserter.setString(4, siMinimum);			inserter.setString(5, unsignedMinimum);			inserter.setString(6, miMinimum);			inserter.setString(7, unsignedMinimum);			inserter.setString(8, iMinimum);			inserter.setString(9, unsignedMinimum);			inserter.setString(10, biMinimum);			inserter.setString(11, unsignedMinimum);			inserter.executeUpdate();			inserter.setInt(1, 1);			inserter.setString(2, tiMaximum);			inserter.setString(3, utiMaximum);			inserter.setString(4, siMaximum);			inserter.setString(5, usiMaximum);			inserter.setString(6, miMaximum);			inserter.setString(7, umiMaximum);			inserter.setString(8, iMaximum);			inserter.setString(9, uiMaximum);			inserter.setString(10, biMaximum);			inserter.setString(11, ubiMaximum);			inserter.executeUpdate();			PreparedStatement selector = this.conn					.prepareStatement("SELECT * FROM testBinaryResultSetNumericTypes ORDER by rowOrder ASC");			this.rs = selector.executeQuery();			assertTrue(this.rs.next());			assertTrue(this.rs.getString(2).equals(tiMinimum));			assertTrue(this.rs.getString(3).equals(unsignedMinimum));			assertTrue(this.rs.getString(4).equals(siMinimum));			assertTrue(this.rs.getString(5).equals(unsignedMinimum));			assertTrue(this.rs.getString(6).equals(miMinimum));			assertTrue(this.rs.getString(7).equals(unsignedMinimum));			assertTrue(this.rs.getString(8).equals(iMinimum));			assertTrue(this.rs.getString(9).equals(unsignedMinimum));			assertTrue(this.rs.getString(10).equals(biMinimum));			assertTrue(this.rs.getString(11).equals(unsignedMinimum));			assertTrue(this.rs.next());			assertTrue(this.rs.getString(2) + " != " + tiMaximum, this.rs					.getString(2).equals(tiMaximum));			assertTrue(this.rs.getString(3) + " != " + utiMaximum, this.rs					.getString(3).equals(utiMaximum));			assertTrue(this.rs.getString(4) + " != " + siMaximum, this.rs					.getString(4).equals(siMaximum));			assertTrue(this.rs.getString(5) + " != " + usiMaximum, this.rs					.getString(5).equals(usiMaximum));			assertTrue(this.rs.getString(6) + " != " + miMaximum, this.rs					.getString(6).equals(miMaximum));			assertTrue(this.rs.getString(7) + " != " + umiMaximum, this.rs					.getString(7).equals(umiMaximum));			assertTrue(this.rs.getString(8) + " != " + iMaximum, this.rs					.getString(8).equals(iMaximum));			assertTrue(this.rs.getString(9) + " != " + uiMaximum, this.rs					.getString(9).equals(uiMaximum));			assertTrue(this.rs.getString(10) + " != " + biMaximum, this.rs					.getString(10).equals(biMaximum));			assertTrue(this.rs.getString(11) + " != " + ubiMaximum, this.rs					.getString(11).equals(ubiMaximum));			assertTrue(!this.rs.next());		} finally {			this.stmt					.executeUpdate("DROP TABLE IF EXISTS testBinaryResultSetNumericTypes");		}	}	/**	 * Tests stored procedure functionality	 *	 * @throws Exception	 *             if an error occurs.	 */	public void testCallableStatement() throws Exception {		if (versionMeetsMinimum(5, 0)) {			CallableStatement cStmt = null;			String stringVal = "abcdefg";			int intVal = 42;			try {				try {					this.stmt.executeUpdate("DROP PROCEDURE testCallStmt");				} catch (SQLException sqlEx) {					if (sqlEx.getMessage().indexOf("does not exist") == -1) {						throw sqlEx;					}				}				this.stmt.executeUpdate("DROP TABLE IF EXISTS callStmtTbl");				this.stmt

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品视频一区二区三区免费| 国产永久精品大片wwwapp| 日韩欧美电影一二三| av影院午夜一区| 国产精品一区久久久久| 亚洲与欧洲av电影| 中文字幕一区二区三区视频| 欧美一级一区二区| 在线播放日韩导航| 色狠狠色狠狠综合| 91丨porny丨首页| 国产一区二区三区精品视频| 亚洲大片免费看| 亚洲欧美日韩国产另类专区| 国产无一区二区| 久久综合色鬼综合色| 在线综合视频播放| 欧美一区二区视频在线观看2020| 在线观看一区二区精品视频| 97久久精品人人爽人人爽蜜臀| 高清beeg欧美| av网站一区二区三区| 成人免费看的视频| www.66久久| 日本高清不卡一区| 91蜜桃网址入口| 日本精品视频一区二区| 91香蕉视频黄| 欧美日高清视频| 欧美电影免费观看高清完整版 | 亚洲国产精品99久久久久久久久| 日韩视频免费观看高清完整版在线观看 | 欧美裸体一区二区三区| 色综合天天视频在线观看| 欧美视频一区二区三区在线观看| 欧美日韩不卡视频| 久久午夜免费电影| 亚洲一区在线播放| 黄色日韩三级电影| 91麻豆视频网站| 91精品国产综合久久久久久久| 日韩欧美激情在线| 国产精品毛片无遮挡高清| 一区二区三区精品| 国产精品主播直播| 欧美午夜寂寞影院| 国产精品少妇自拍| 午夜视频在线观看一区二区| 国产在线精品免费| 欧美日韩精品一区二区三区蜜桃| 国产清纯在线一区二区www| 亚洲国产精品尤物yw在线观看| 国产精品原创巨作av| 欧美浪妇xxxx高跟鞋交| 亚洲日本电影在线| 国产成都精品91一区二区三| 日韩视频不卡中文| 午夜精品久久久久久久99水蜜桃 | 国产成人亚洲综合a∨婷婷图片| 欧美日韩精品是欧美日韩精品| 国产欧美综合在线观看第十页 | 日韩午夜av电影| 亚洲成人精品影院| 色国产综合视频| 1区2区3区精品视频| 成人午夜免费电影| 久久久影院官网| 国产酒店精品激情| 久久久国产综合精品女国产盗摄| 久久 天天综合| 精品国产91久久久久久久妲己| 日本欧美一区二区在线观看| 欧美日韩在线电影| 日韩中文字幕区一区有砖一区 | 欧美日韩久久久一区| 亚洲一区二区免费视频| 欧美三级电影在线观看| 亚洲妇女屁股眼交7| 欧美精品乱人伦久久久久久| 亚洲国产精品影院| 亚洲视频免费在线观看| 国产一区二区三区四区五区入口| 精品久久一二三区| 成人久久视频在线观看| 亚洲日本电影在线| 精品国产免费一区二区三区四区| 五月激情综合色| 久久色.com| 91在线国产福利| 天天射综合影视| 国产日产精品1区| 欧日韩精品视频| 国产一区二区免费视频| 亚洲欧洲日韩在线| 欧美一区二区啪啪| 97精品久久久午夜一区二区三区| 天堂av在线一区| 亚洲人成网站在线| 日韩欧美一区二区免费| 色一区在线观看| 国产麻豆精品在线| 亚洲成人黄色影院| 国产精品久久久久久久久免费丝袜| 日本道精品一区二区三区| 久久激情五月婷婷| 亚洲精选一二三| 国产午夜久久久久| 欧美一级二级在线观看| 91麻豆免费观看| 国产精品18久久久久久久久| 亚洲成人黄色小说| 亚洲精品成人少妇| 国产精品黄色在线观看| 欧美草草影院在线视频| 欧美日韩一区在线| 在线观看国产一区二区| 99精品久久久久久| 国产风韵犹存在线视精品| 国产一区二区三区香蕉| 国产白丝精品91爽爽久久 | 亚洲免费观看在线视频| 国产精品伦理一区二区| 欧美韩国一区二区| 国产精品久久久久三级| 欧美国产一区二区| 日本一区二区三区dvd视频在线| 久久色成人在线| 国产精品免费视频一区| 中文字幕乱码亚洲精品一区| 欧美激情一区二区| 亚洲图片另类小说| 亚洲成人高清在线| 激情综合五月婷婷| 成人午夜激情影院| 91久久一区二区| 欧美日韩精品欧美日韩精品| 日韩欧美色综合网站| 国产性做久久久久久| 亚洲精品伦理在线| 日本强好片久久久久久aaa| 久久国产精品72免费观看| 国产精品一线二线三线精华| 99国产精品久久久久久久久久久| 色综合激情五月| 日韩精品一区二区在线观看| 国产精品久久毛片av大全日韩| 日本欧美大码aⅴ在线播放| 国产日韩精品一区二区浪潮av| 日韩一区二区三区在线| 亚洲国产精品成人综合色在线婷婷| √…a在线天堂一区| 亚洲一区电影777| 国产精品一区二区不卡| av在线播放不卡| 精品乱人伦小说| 一区二区三区**美女毛片| 国产原创一区二区| 欧美放荡的少妇| 欧美激情中文不卡| 麻豆视频观看网址久久| 91久久精品网| 国产精品理论片| 精品一区二区三区在线观看国产| 欧美日产国产精品| 亚洲国产毛片aaaaa无费看 | 日韩精品在线一区| 男人的天堂久久精品| 欧美日韩在线观看一区二区| 18涩涩午夜精品.www| 成人av在线资源| 国产精品久久久久久妇女6080| 美女视频第一区二区三区免费观看网站 | 日本亚洲欧美天堂免费| 欧美日韩一区二区三区视频| 亚洲欧美福利一区二区| 99久久精品国产精品久久| 中文字幕亚洲视频| 972aa.com艺术欧美| 亚洲欧洲av另类| 色94色欧美sute亚洲线路一久| 一区二区三区小说| 欧美喷潮久久久xxxxx| 免播放器亚洲一区| 久久精品亚洲精品国产欧美| 国产黄色成人av| 伊人夜夜躁av伊人久久| 69堂国产成人免费视频| 秋霞国产午夜精品免费视频| 久久综合色一综合色88| 成人午夜精品在线| 精品一区二区日韩| 日本一区二区不卡视频| 国产自产v一区二区三区c| 精品婷婷伊人一区三区三| 一区二区三区免费看视频| 成人夜色视频网站在线观看| 色狠狠综合天天综合综合| 亚洲一区二区三区四区五区黄 | 国产精品久久午夜| 91原创在线视频|