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

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

?? callablestatementtest.java

?? 用于JAVA數據庫連接.解壓就可用,方便得很
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* 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 com.mysql.jdbc.SQLError;import com.mysql.jdbc.log.StandardLogger;import testsuite.BaseTestCase;import java.sql.CallableStatement;import java.sql.Connection;import java.sql.ParameterMetaData;import java.sql.ResultSet;import java.sql.ResultSetMetaData;import java.sql.SQLException;import java.sql.Types;import java.util.Properties;/** * Tests callable statement functionality. *  * @author Mark Matthews * @version $Id: CallableStatementTest.java,v 1.1.2.1 2005/05/13 18:58:37 *          mmatthews Exp $ */public class CallableStatementTest extends BaseTestCase {	/**	 * DOCUMENT ME!	 * 	 * @param name	 */	public CallableStatementTest(String name) {		super(name);		// TODO Auto-generated constructor stub	}	/**	 * Tests functioning of inout parameters	 * 	 * @throws Exception	 *             if the test fails	 */	public void testInOutParams() throws Exception {		if (versionMeetsMinimum(5, 0)) {			CallableStatement storedProc = null;			try {				this.stmt						.executeUpdate("DROP PROCEDURE IF EXISTS testInOutParam");				this.stmt						.executeUpdate("create procedure testInOutParam(IN p1 VARCHAR(255), INOUT p2 INT)\n"								+ "begin\n"								+ " DECLARE z INT;\n"								+ "SET z = p2 + 1;\n"								+ "SET p2 = z;\n"								+ "SELECT p1;\n"								+ "SELECT CONCAT('zyxw', p1);\n"								+ "end\n");				storedProc = this.conn.prepareCall("{call testInOutParam(?, ?)}");				storedProc.setString(1, "abcd");				storedProc.setInt(2, 4);				storedProc.registerOutParameter(2, Types.INTEGER);				storedProc.execute();						assertEquals(5, storedProc.getInt(2));			} finally {				this.stmt.executeUpdate("DROP PROCEDURE IF EXISTS testInOutParam");			}		}	}	public void testBatch() throws Exception {		if (versionMeetsMinimum(5, 0)) {			Connection batchedConn = null;						try {				createTable("testBatchTable", "(field1 INT)");				createProcedure("testBatch", "(IN foo VARCHAR(15))\n"								+ "begin\n"								+ "INSERT INTO testBatchTable VALUES (foo);\n"								+ "end\n");				executeBatchedStoredProc(this.conn);								batchedConn = getConnectionWithProps("rewriteBatchedStatements=true,profileSQL=true");								StringBuffer outBuf = new StringBuffer();				StandardLogger.bufferedLog = outBuf;				executeBatchedStoredProc(batchedConn);				String[] log = outBuf.toString().split(";");				assertTrue(log.length > 20);			} finally {				StandardLogger.bufferedLog = null;								closeMemberJDBCResources();								if (batchedConn != null) {					batchedConn.close();				}			}		}	}		private void executeBatchedStoredProc(Connection c) throws Exception {		this.stmt.executeUpdate("TRUNCATE TABLE testBatchTable");				CallableStatement storedProc = c.prepareCall("{call testBatch(?)}");		try {			int numBatches = 300;						for (int i = 0; i < numBatches; i++) {				storedProc.setInt(1, i + 1);				storedProc.addBatch();			}						int[] counts = storedProc.executeBatch();						assertEquals(numBatches, counts.length);						for (int i = 0; i < numBatches; i++) {				assertEquals(1, counts[i]);			}				this.rs = this.stmt.executeQuery("SELECT field1 FROM testBatchTable ORDER BY field1 ASC");						for (int i = 0; i < numBatches; i++) {				assertTrue(this.rs.next());				assertEquals(i + 1, this.rs.getInt(1));			}		} finally {			closeMemberJDBCResources();						if (storedProc != null) {				storedProc.close();			}		}	}	/**	 * Tests functioning of output parameters.	 * 	 * @throws Exception	 *             if the test fails.	 */	public void testOutParams() throws Exception {		if (versionMeetsMinimum(5, 0)) {			CallableStatement storedProc = null;			try {				this.stmt						.executeUpdate("DROP PROCEDURE IF EXISTS testOutParam");				this.stmt						.executeUpdate("CREATE PROCEDURE testOutParam(x int, out y int)\n"								+ "begin\n"								+ "declare z int;\n"								+ "set z = x+1, y = z;\n" + "end\n");				storedProc = this.conn.prepareCall("{call testOutParam(?, ?)}");				storedProc.setInt(1, 5);				storedProc.registerOutParameter(2, Types.INTEGER);				storedProc.execute();				System.out.println(storedProc);				int indexedOutParamToTest = storedProc.getInt(2);								if (!isRunningOnJdk131()) {					int namedOutParamToTest = storedProc.getInt("y");									assertTrue("Named and indexed parameter are not the same",						indexedOutParamToTest == namedOutParamToTest);					assertTrue("Output value not returned correctly",						indexedOutParamToTest == 6);									// Start over, using named parameters, this time					storedProc.clearParameters();					storedProc.setInt("x", 32);					storedProc.registerOutParameter("y", Types.INTEGER);						storedProc.execute();						indexedOutParamToTest = storedProc.getInt(2);					namedOutParamToTest = storedProc.getInt("y");						assertTrue("Named and indexed parameter are not the same",							indexedOutParamToTest == namedOutParamToTest);					assertTrue("Output value not returned correctly",							indexedOutParamToTest == 33);						try {						storedProc.registerOutParameter("x", Types.INTEGER);						assertTrue(								"Should not be able to register an out parameter on a non-out parameter",								true);					} catch (SQLException sqlEx) {						if (!SQLError.SQL_STATE_ILLEGAL_ARGUMENT.equals(sqlEx								.getSQLState())) {							throw sqlEx;						}					}										try {						storedProc.getInt("x");						assertTrue(								"Should not be able to retreive an out parameter on a non-out parameter",								true);					} catch (SQLException sqlEx) {						if (!SQLError.SQL_STATE_COLUMN_NOT_FOUND.equals(sqlEx								.getSQLState())) {							throw sqlEx;						}					}				}				try {					storedProc.registerOutParameter(1, Types.INTEGER);					assertTrue(							"Should not be able to register an out parameter on a non-out parameter",							true);				} catch (SQLException sqlEx) {					if (!SQLError.SQL_STATE_ILLEGAL_ARGUMENT.equals(sqlEx							.getSQLState())) {						throw sqlEx;					}				}							} finally {				this.stmt.executeUpdate("DROP PROCEDURE testOutParam");			}		}	}	/**	 * Tests functioning of output parameters.	 * 	 * @throws Exception	 *             if the test fails.	 */	public void testResultSet() throws Exception {		if (versionMeetsMinimum(5, 0)) {			CallableStatement storedProc = null;			try {				this.stmt						.executeUpdate("DROP TABLE IF EXISTS testSpResultTbl1");				this.stmt						.executeUpdate("DROP TABLE IF EXISTS testSpResultTbl2");				this.stmt						.executeUpdate("CREATE TABLE testSpResultTbl1 (field1 INT)");				this.stmt						.executeUpdate("INSERT INTO testSpResultTbl1 VALUES (1), (2)");				this.stmt						.executeUpdate("CREATE TABLE testSpResultTbl2 (field2 varchar(255))");				this.stmt						.executeUpdate("INSERT INTO testSpResultTbl2 VALUES ('abc'), ('def')");				this.stmt						.executeUpdate("DROP PROCEDURE IF EXISTS testSpResult");				this.stmt						.executeUpdate("CREATE PROCEDURE testSpResult()\n"								+ "BEGIN\n"								+ "SELECT field2 FROM testSpResultTbl2 WHERE field2='abc';\n"								+ "UPDATE testSpResultTbl1 SET field1=2;\n"

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲电影在线免费观看| 国产精品系列在线观看| 国内精品免费在线观看| 99精品国产视频| 91精品国产综合久久香蕉的特点| 欧美国产日本视频| 美腿丝袜在线亚洲一区| 91污片在线观看| 国产亚洲一本大道中文在线| 免费高清视频精品| 欧美日本乱大交xxxxx| 中文字幕不卡在线观看| 国产一区在线不卡| 91精品国产综合久久国产大片| 亚洲人妖av一区二区| 国产精品99久久久久久久女警| 5858s免费视频成人| 夜夜嗨av一区二区三区四季av| 成人午夜免费视频| 久久久久9999亚洲精品| 久久精品噜噜噜成人av农村| 777午夜精品免费视频| 亚洲国产视频一区二区| 欧美在线free| 一区二区成人在线| 91日韩一区二区三区| 中文字幕亚洲欧美在线不卡| 丁香婷婷综合激情五月色| 亚洲精品在线观看网站| 精品在线一区二区| 日韩美一区二区三区| 奇米四色…亚洲| 91精品国产综合久久精品 | 国产日韩精品一区二区三区在线| 免费av成人在线| 日韩三级精品电影久久久| 日韩国产精品久久久| 欧美精品 日韩| 日本在线观看不卡视频| 欧美成人性福生活免费看| 捆绑变态av一区二区三区| 亚洲精品一区二区三区蜜桃下载| 国产一区二区三区免费播放| 国产欧美日韩精品一区| 成人免费毛片片v| 亚洲色欲色欲www| 欧美在线观看你懂的| 青椒成人免费视频| 久久理论电影网| 成人小视频在线观看| 中文字幕日本乱码精品影院| 欧美专区在线观看一区| 免费的成人av| 国产无遮挡一区二区三区毛片日本| 懂色av一区二区三区蜜臀 | 日本高清视频一区二区| 亚洲国产精品久久不卡毛片| 欧美精品 日韩| 国产毛片精品一区| 亚洲精品日韩一| 日韩欧美高清dvd碟片| 国产精品一区二区三区乱码| 最新成人av在线| 91精品国产入口| 成人毛片视频在线观看| 亚洲网友自拍偷拍| 久久久久久久免费视频了| 91看片淫黄大片一级在线观看| 日精品一区二区| 中文字幕亚洲电影| 8x8x8国产精品| 99精品一区二区| 麻豆国产91在线播放| 亚洲女同一区二区| www久久精品| 91久久精品一区二区三| 国产一区二区按摩在线观看| 亚洲男同1069视频| 欧美精品一区二区三区四区| 欧美亚洲日本一区| 高清在线成人网| 裸体歌舞表演一区二区| 亚洲黄一区二区三区| 精品成人免费观看| 日本韩国一区二区三区视频| 国产69精品久久99不卡| 麻豆国产精品一区二区三区| 亚洲一区二区三区美女| 一区免费观看视频| 久久一夜天堂av一区二区三区| 欧美三级日本三级少妇99| 99久久夜色精品国产网站| 国产精品一二三四区| 日韩电影在线免费观看| 一区二区三区成人| 国产精品嫩草影院com| 久久久美女毛片| 欧美一区二区三区喷汁尤物| 欧美性生活久久| 99国内精品久久| 大桥未久av一区二区三区中文| 免费成人深夜小野草| 亚洲精品第1页| 亚洲欧美在线aaa| 国产欧美一区二区三区在线看蜜臀| 欧美电视剧免费观看| 欧美精品日韩一区| 欧美夫妻性生活| 在线成人小视频| 欧美色视频在线观看| 91黄视频在线| 欧美主播一区二区三区美女| 色婷婷激情一区二区三区| 91丨porny丨中文| 一本色道久久加勒比精品 | 亚洲精品成人精品456| 日韩伦理免费电影| ...中文天堂在线一区| 国产精品第五页| 国产精品成人免费精品自在线观看 | 欧美影院午夜播放| 欧美乱熟臀69xxxxxx| 欧美另类videos死尸| 欧美一区二区三区在线观看| 欧美一区二区三区四区高清| 精品国内片67194| 国产亚洲精品aa| 中文字幕日韩一区| 亚洲一区二区不卡免费| 五月婷婷综合激情| 久久99热国产| k8久久久一区二区三区| 91麻豆国产福利在线观看| 欧美影视一区在线| 日韩欧美中文字幕公布| 久久网站热最新地址| 欧美高清在线一区| 亚洲另类在线一区| 婷婷综合五月天| 国产一区在线精品| 97久久精品人人爽人人爽蜜臀| 欧美亚洲综合一区| 精品国产伦一区二区三区观看方式 | 亚洲综合一区二区精品导航| 日韩激情视频网站| 国产成人丝袜美腿| 一本到高清视频免费精品| 91精品国产综合久久精品麻豆| 久久色成人在线| 亚洲精品免费播放| 精品无人区卡一卡二卡三乱码免费卡| 久久99久久99精品免视看婷婷| 日本视频在线一区| 久久国产精品免费| www.欧美日韩国产在线| 精品视频1区2区| 亚洲精品一区二区三区精华液 | 色婷婷综合久色| 91麻豆精品国产91久久久久久| 国产色一区二区| 亚洲精品ww久久久久久p站| 免费看精品久久片| 91丨porny丨国产| 日韩免费高清电影| 亚洲综合在线五月| 懂色av中文一区二区三区| 欧洲精品一区二区三区在线观看| 精品国产一区二区三区久久久蜜月 | 91免费看视频| 日韩一区二区电影网| 亚洲色图欧洲色图| 国产自产2019最新不卡| 欧美日韩国产首页| 中文字幕一区二区不卡| 国产在线精品一区二区不卡了| 欧洲av在线精品| 国产日韩av一区| 久草精品在线观看| 91精品国产色综合久久| 亚洲五码中文字幕| 91免费在线播放| 综合久久给合久久狠狠狠97色 | 久久久亚洲国产美女国产盗摄| 亚洲国产视频一区二区| 一本大道久久精品懂色aⅴ| 国产视频一区在线播放| 黑人精品欧美一区二区蜜桃| 4438x亚洲最大成人网| 亚洲大尺度视频在线观看| caoporen国产精品视频| 欧美国产欧美综合| 国产**成人网毛片九色| 久久亚洲私人国产精品va媚药| 秋霞电影网一区二区| 欧美日韩国产小视频在线观看| 一卡二卡三卡日韩欧美| 欧美午夜影院一区| 亚洲.国产.中文慕字在线| 欧美综合天天夜夜久久| 一区二区三区四区不卡在线 |