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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? c3p0benchmarkapp.java

?? c3p0數(shù)據(jù)庫(kù)連接池實(shí)現(xiàn)源碼
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* * Distributed as part of c3p0 v.0.9.1-pre6 * * Copyright (C) 2005 Machinery For Change, Inc. * * Author: Steve Waldman <swaldman@mchange.com> * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, as  * published by the Free Software Foundation. * * This software 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this software; see the file LICENSE.  If not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. */package com.mchange.v2.c3p0.test;import java.util.*;import java.sql.*;import javax.sql.*;import com.mchange.v2.c3p0.*;import com.mchange.v1.db.sql.*;public final class C3P0BenchmarkApp{    final static String EMPTY_TABLE_CREATE = "CREATE TABLE emptyyukyuk (a varchar(8), b varchar(8))";    final static String EMPTY_TABLE_SELECT = "SELECT * FROM emptyyukyuk";    final static String EMPTY_TABLE_DROP   = "DROP TABLE emptyyukyuk";        final static String EMPTY_TABLE_CONDITIONAL_SELECT = "SELECT * FROM emptyyukyuk where a = ?";    final static String N_ENTRY_TABLE_CREATE = "CREATE TABLE n_entryyukyuk (a INTEGER)";    final static String N_ENTRY_TABLE_INSERT = "INSERT INTO n_entryyukyuk VALUES ( ? )";    final static String N_ENTRY_TABLE_SELECT = "SELECT * FROM n_entryyukyuk";    final static String N_ENTRY_TABLE_DROP   = "DROP TABLE n_entryyukyuk";    //final static int NUM_ITERATIONS = 20;    final static int NUM_ITERATIONS = 2000;    //final static int NUM_ITERATIONS = 10000;    //final static int NUM_ITERATIONS = 20000;    //final static int NUM_ITERATIONS = 100000;    public static void main(String[] argv)    {//      com.mchange.v2.log.MLog.getLogger( C3P0BenchmarkApp.class ).info("this is some info.");// 	com.mchange.v2.log.MLog.getLogger( C3P0BenchmarkApp.class ).log(com.mchange.v2.log.MLevel.WARNING, "this is a warning.", new Exception("test"));// 	com.mchange.v2.log.MLog.getLogger( C3P0BenchmarkApp.class ).log(com.mchange.v2.log.MLevel.FINE, "this is fine.");// 	System.getProperties().put("sprong", java.awt.Color.blue);// 	System.getProperties().put(java.awt.Color.blue, "sprong");	DataSource ds_unpooled = null;	DataSource ds_pooled   = null;	try	    {				String jdbc_url = null;		String username = null;		String password = null;		if (argv.length == 3)		    {			jdbc_url = argv[0];			username = argv[1];			password = argv[2];		    }		else if (argv.length == 1)		    {			jdbc_url = argv[0];			username = null;			password = null;		    }		else		    usage();		if (! jdbc_url.startsWith("jdbc:") )		    usage();//  		ds_unpooled = DriverManagerDataSourceFactory.create(jdbc_url, username, password);//  		ds_pooled//  //  		    = PoolBackedDataSourceFactory.create(jdbc_url, username, password);//      		    = PoolBackedDataSourceFactory.create(jdbc_url, //      							 username, //      							 password,//      							 5,//      							 20,//      							 5,//      							 0,//      							 100 );		ds_unpooled = DataSources.unpooledDataSource(jdbc_url, username, password);		//ds_pooled = DataSources.pooledDataSource( ds_unpooled );   		//DataSource ds_unpooled_screwy = C3P0TestUtils.unreliableCommitDataSource( ds_unpooled );   		//ds_pooled = DataSources.pooledDataSource( ds_unpooled_screwy );// 		PoolConfig pc = new PoolConfig();// 		pc.setMaxStatements(200);// 		pc.setCheckoutTimeout(500);//  		ds_pooled = DataSources.pooledDataSource( ds_unpooled, pc );//  		ds_pooled = DataSources.pooledDataSource( ds_unpooled, "foo", "goo" );		//ComboPooledDataSource cpds = new ComboPooledDataSource("dumbTestConfig"); 		ComboPooledDataSource cpds = new ComboPooledDataSource(); 		cpds.setJdbcUrl( jdbc_url ); 		cpds.setUser( username ); 		cpds.setPassword( password ); 		ds_pooled = cpds; 		create(ds_pooled);		System.out.println("Please wait. Tests can be very slow.");		List l = new ArrayList(); 		l.add( new ConnectionAcquisitionTest() );    		l.add( new StatementCreateTest() );    		l.add( new StatementEmptyTableSelectTest() );   		//l.add( new DataBaseMetaDataListNonexistentTablesTest() );   		l.add( new PreparedStatementEmptyTableSelectTest() ); 		l.add( new PreparedStatementAcquireTest() );   		l.add( new ResultSetReadTest() );    		l.add( new FiveThreadPSQueryTestTest() );		for (int i = 0, len = l.size(); i < len; ++i)		    ((Test) l.get(i)).perform( ds_unpooled, ds_pooled, NUM_ITERATIONS );	    }	catch( Throwable t )	    {		System.err.print("Aborting tests on Throwable -- ");		t.printStackTrace(); 		if (t instanceof Error)		    throw (Error) t;	    }	finally	    {		//System.err.println( "pooled data sources: " + C3P0Registry.getPooledDataSources() ); 		try { drop(ds_pooled); }		catch (Exception e)		    { e.printStackTrace(); } 		try { DataSources.destroy(ds_pooled); }		catch (Exception e)		    { e.printStackTrace(); } 		try { DataSources.destroy(ds_unpooled); }		catch (Exception e)		    { e.printStackTrace(); }	    }    }    private static void usage()    {	System.err.println("java " +			   "-Djdbc.drivers=<comma_sep_list_of_drivers> " +			   C3P0BenchmarkApp.class.getName() +			   " <jdbc_url> [<username> <password>]" );	System.exit(-1);    }    static void create(DataSource ds)	throws SQLException    {	System.err.println("Creating test schema.");	Connection        con = null;	PreparedStatement ps1 = null;	PreparedStatement ps2 = null;	PreparedStatement ps3 = null;	try 	    { 		con = ds.getConnection();		ps1 = con.prepareStatement(EMPTY_TABLE_CREATE);		ps2 = con.prepareStatement(N_ENTRY_TABLE_CREATE);		ps3 = con.prepareStatement(N_ENTRY_TABLE_INSERT);		ps1.executeUpdate();		ps2.executeUpdate();  		for (int i = 0; i < NUM_ITERATIONS; ++i)   		    {   			ps3.setInt(1, i );   			ps3.executeUpdate();   			System.err.print('.');   		    }		System.err.println();		System.err.println("Test schema created.");	    }	finally	    {		StatementUtils.attemptClose( ps1 );		StatementUtils.attemptClose( ps2 );		StatementUtils.attemptClose( ps3 );		ConnectionUtils.attemptClose( con ); 	    }    }    static void drop(DataSource ds)	throws SQLException    {	Connection con        = null;	PreparedStatement ps1 = null;	PreparedStatement ps2 = null;	try 	    { 		con = ds.getConnection();		ps1 = con.prepareStatement(EMPTY_TABLE_DROP);		ps2 = con.prepareStatement(N_ENTRY_TABLE_DROP);		ps1.executeUpdate();		ps2.executeUpdate();		// should be superfluous 'cuz should be autocommit		//con.commit();		System.err.println("Test schema dropped.");	    }	finally	    {		StatementUtils.attemptClose( ps1 );		StatementUtils.attemptClose( ps2 );		ConnectionUtils.attemptClose( con ); 	    }    }    static abstract class Test    {	String name;		Test(String name)	{ this.name = name; }	public void perform(DataSource unpooled, DataSource pooled, int iterations) throws Exception	{	    double msecs_unpooled = test(unpooled, iterations) / ((double) iterations);	    double msecs_pooled = test(pooled, iterations) / ((double) iterations);	    System.out.println(name + " [ " + iterations + " iterations ]:");	    System.out.println('\t' + "unpooled: " + msecs_unpooled + " msecs");	    System.out.println('\t' + "  pooled: " + msecs_pooled + " msecs");	    System.out.println('\t' + "speed-up factor: " + msecs_unpooled / msecs_pooled + " times");	    System.out.println('\t' + "speed-up absolute: " + (msecs_unpooled - msecs_pooled)  + 			       " msecs");	    System.out.println();// 	    PooledDataSource pds = (PooledDataSource) pooled;// 	    System.out.println( pds.getNumConnections() );// 	    System.out.println( pds.getNumIdleConnections() );// 	    System.out.println( pds.getNumBusyConnections() );// 	    System.out.println( pds.getNumConnectionsAllAuths() );	}	protected abstract long test(DataSource ds, int n) throws Exception;    }    static class ConnectionAcquisitionTest extends Test    {	ConnectionAcquisitionTest()	{ super("Connection Acquisition and Cleanup"); }	protected long test(DataSource ds, int n) throws Exception	{	    long start;	    long end;	    	    start = System.currentTimeMillis();	    for (int i = 0; i < n; ++i)		{		    Connection con = null;		    try			{ con = ds.getConnection(); }		    finally			{ ConnectionUtils.attemptClose( con ); }		    //System.err.print(i + "\t");		}	    end = System.currentTimeMillis();	    return end - start;	}    }    static class StatementCreateTest extends Test    {	StatementCreateTest()	{ super("Statement Creation and Cleanup"); }	protected long test(DataSource ds, int n) throws SQLException	{	    Connection con = null;	    try 		{ 		    con = ds.getConnection();		    return test( con , n );		}	    finally		{ ConnectionUtils.attemptClose( con ); }	}	long test(Connection con, int n) throws SQLException	{ 	    long start;	    long end;	    	    Statement stmt = null;	    start = System.currentTimeMillis();	    for (int i = 0; i < n; ++i)		{		    try			{ stmt = con.createStatement();	}		    finally			{ StatementUtils.attemptClose( stmt ); }		}	    end = System.currentTimeMillis();	    return end - start;	}    }    static class StatementEmptyTableSelectTest extends Test    {	StatementEmptyTableSelectTest()	{ super("Empty Table Statement Select (on a single Statement)"); }	protected long test(DataSource ds, int n) throws SQLException	{	    Connection con  = null;	    Statement  stmt = null;	    try 		{ 		    con = ds.getConnection();		    stmt = con.createStatement();		    //System.err.println( stmt.getClass().getName() );		    return test( stmt , n );		}	    finally		{ 		    StatementUtils.attemptClose( stmt ); 		    ConnectionUtils.attemptClose( con ); 		}	}	long test(Statement stmt, int n) throws SQLException	{ 	    long start;	    long end;	    	    start = System.currentTimeMillis();	    for (int i = 0; i < n; ++i)		stmt.executeQuery(EMPTY_TABLE_SELECT).close();	    end = System.currentTimeMillis();	    return end - start;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av在线播放不卡| 久久精品一二三| 精品久久免费看| 国产精品传媒入口麻豆| 日韩专区一卡二卡| 成人av在线网| 国产色91在线| 日产国产高清一区二区三区| a亚洲天堂av| 欧美精品一区二区三区在线播放 | 在线不卡a资源高清| 欧美韩国日本一区| 精品在线一区二区| 欧美亚日韩国产aⅴ精品中极品| 国产精品国产三级国产普通话蜜臀 | 成人欧美一区二区三区| 黄色精品一二区| 欧美一区二区三区的| 亚洲综合激情小说| 成人教育av在线| 中文字幕免费不卡| 国产精品亚洲午夜一区二区三区| 日韩你懂的在线播放| 亚洲超丰满肉感bbw| 欧美色成人综合| 亚洲午夜一区二区三区| 欧美性videosxxxxx| 亚洲永久精品国产| 欧美日韩免费电影| 亚洲午夜精品久久久久久久久| 91在线视频播放| 亚洲欧美日韩国产成人精品影院 | 日韩一区中文字幕| 99久久免费国产| 自拍偷拍国产亚洲| 91免费版在线看| 亚洲欧洲综合另类| 欧美综合天天夜夜久久| 亚洲国产日韩综合久久精品| 欧美系列日韩一区| 天使萌一区二区三区免费观看| 欧美丰满美乳xxx高潮www| 午夜在线电影亚洲一区| 日韩一区二区免费电影| 精品一区二区综合| 亚洲国产精品精华液ab| 色呦呦国产精品| 亚洲一二三区不卡| 日韩一区二区免费高清| 国产东北露脸精品视频| 亚洲视频香蕉人妖| 欧美精品乱码久久久久久按摩 | 99久久精品国产毛片| 一区二区三区国产| 日韩欧美一二三| 福利一区二区在线| 亚洲一区二区三区国产| 日韩视频永久免费| 成人激情动漫在线观看| 亚洲一区二区欧美日韩| 亚洲精品一区二区三区四区高清 | 日韩写真欧美这视频| 国产成人精品免费一区二区| 伊人色综合久久天天人手人婷| 欧美日韩黄色一区二区| 国产精品1区二区.| 亚洲精品欧美专区| 欧美va日韩va| 在线视频欧美精品| 国产精品一区二区在线观看网站| 亚洲精品国产第一综合99久久| 欧美一卡二卡在线| 99久久精品免费看国产免费软件| 亚洲高清免费视频| 欧美激情一区二区三区| 4438成人网| 99国产精品久| 韩国一区二区视频| 亚洲三级在线看| 亚洲精品一区二区三区四区高清| 在线免费观看视频一区| 国产91精品免费| 五月婷婷久久丁香| 1000部国产精品成人观看| 日韩女优毛片在线| 精品视频999| 波多野结衣在线aⅴ中文字幕不卡| 日韩av一区二区在线影视| 中文字幕一区二区三区蜜月| 精品粉嫩超白一线天av| 欧美亚洲高清一区二区三区不卡| 国产成人av影院| 蜜桃av一区二区三区电影| 亚洲综合男人的天堂| 国产精品久久久久aaaa| 久久久久久影视| 欧美第一区第二区| 欧美精品在线观看播放| 在线精品视频免费观看| 色综合天天在线| 成人丝袜18视频在线观看| 激情六月婷婷久久| 麻豆精品国产传媒mv男同| 亚洲一区二区视频在线观看| 亚洲另类春色校园小说| 国产精品国产馆在线真实露脸 | 风间由美中文字幕在线看视频国产欧美| 日韩在线一二三区| 香蕉成人伊视频在线观看| 亚洲高清免费观看| 亚洲亚洲人成综合网络| 亚洲午夜久久久久久久久电影网| 亚洲精品免费一二三区| 亚洲蜜臀av乱码久久精品 | 国产亚洲精品超碰| 久久久久久久久久久久久久久99| 日韩精品一区二区三区老鸭窝 | 日韩西西人体444www| 91精品视频网| 精品女同一区二区| 久久综合久久综合亚洲| 欧美激情在线免费观看| 国产精品久久久久7777按摩| 国产精品大尺度| 亚洲在线观看免费| 日韩av一级片| 极品尤物av久久免费看| 成人性生交大片免费看在线播放| 不卡一区二区在线| 色婷婷综合久久久久中文一区二区 | 日韩av中文字幕一区二区三区| 婷婷久久综合九色综合伊人色| 视频在线在亚洲| 日本成人在线不卡视频| 国产在线播放一区三区四| 国产美女娇喘av呻吟久久| 国产69精品久久99不卡| www.亚洲精品| 欧美色偷偷大香| 欧美大片日本大片免费观看| 日韩一区二区三区电影在线观看| 欧美变态tickle挠乳网站| 2023国产精品自拍| 综合久久综合久久| 日韩精品一二三区| 国产呦萝稀缺另类资源| 91在线播放网址| 欧美电影影音先锋| 国产欧美日韩三级| 亚洲综合色丁香婷婷六月图片| 麻豆一区二区三| 成人av小说网| 91 com成人网| 国产精品美女久久福利网站| 亚洲国产sm捆绑调教视频 | 欧美国产日产图区| 一二三四区精品视频| 国产精品夜夜嗨| 欧美专区在线观看一区| 26uuuu精品一区二区| 亚洲午夜一二三区视频| 国产激情一区二区三区桃花岛亚洲| 91女人视频在线观看| 日韩欧美在线观看一区二区三区| 国产精品久久久久久久久搜平片| 日本伊人精品一区二区三区观看方式| 国产高清精品网站| 91精品国产色综合久久ai换脸| 国产亚洲成aⅴ人片在线观看| 亚洲国产日韩一级| 成人黄色av电影| 久久免费午夜影院| 热久久一区二区| 91蜜桃婷婷狠狠久久综合9色| 久久综合资源网| 午夜精品国产更新| 色综合天天综合色综合av| 国产日韩欧美精品一区| 蜜桃av一区二区在线观看| 欧美性极品少妇| 一区二区在线电影| 成人高清免费观看| 久久影院视频免费| 久久se精品一区二区| 欧美一区日本一区韩国一区| 亚洲欧美一区二区三区孕妇| 成人免费三级在线| 久久色在线观看| 狠狠v欧美v日韩v亚洲ⅴ| 欧美一卡2卡3卡4卡| 亚洲自拍偷拍综合| 91麻豆国产香蕉久久精品| 国产欧美日产一区| 国产乱人伦偷精品视频不卡| 精品人在线二区三区| 亚洲va欧美va人人爽| 欧美性猛片aaaaaaa做受| 亚洲免费观看高清完整版在线观看熊| jvid福利写真一区二区三区| 欧美激情一区二区三区蜜桃视频|