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

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

?? datasources.java

?? c3p0數據庫連接池實現源碼
?? JAVA
字號:
/* * 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;import com.mchange.v2.log.*;import java.beans.PropertyChangeEvent;import java.beans.PropertyVetoException;import java.util.Arrays;import java.util.Collections;import java.util.HashMap;import java.util.HashSet;import java.util.Iterator;import java.util.Map;import java.util.Properties;import java.util.Set;import java.sql.SQLException;import javax.sql.DataSource;import javax.sql.ConnectionPoolDataSource;import com.mchange.v2.sql.SqlUtils;import com.mchange.v2.beans.BeansUtils;/** *  <p>A simple factory class for creating DataSources. Generally, users will call <tt>DataSources.unpooledDataSource()</tt> to get *  a basic DataSource, and then get a pooled version by calling <tt>DataSources.pooledDataSource()</tt>.</p> * *  <p>Most users will not need to worry about configuration details. If you want to use a PreparedStatement cache, be sure to call *  the version of <tt>DataSources.pooledDataSource()</tt> that accepts a <tt>statement_cache_size</tt> parameter, and set that to *  be a number (much) greater than zero. (For maximum performance, you would set this to be several times the number kinds of  *  PreparedStatements you expect your application to use.)</p> * * <p>For those interested in detailed configuration, note that c3p0 pools can be configured by explicit method calls on PoolConfig objects, * by defining System properties, or by defining a <tt>c3p0.properties</tt> file in your resource path. See {@link com.mchange.v2.c3p0.PoolConfig} * for details.</p> * */public final class DataSources{    final static MLogger logger = MLog.getLogger( DataSources.class );    final static Set WRAPPER_CXN_POOL_DATA_SOURCE_OVERWRITE_PROPS; //22 -- includes factory class location    final static Set POOL_BACKED_DATA_SOURCE_OVERWRITE_PROPS; //2 -- includes factory class location, excludes pool-owner id token    static    {	// As of c3p0-0.9.1	//	// This list is no longer updated, as the PoolConfig approach to setting up DataSources	// is now deprecated. (This was getting to be hard to maintain as new config properties	// were added.)	String[] props = new String[]	{	    "checkoutTimeout", //1 	    "acquireIncrement",  //2	    "acquireRetryAttempts", //3	    "acquireRetryDelay", //4	    "autoCommitOnClose", //5	    "connectionTesterClassName", //6	    "forceIgnoreUnresolvedTransactions", //7	    "idleConnectionTestPeriod", //8	    "initialPoolSize", //9	    "maxIdleTime", //10	    "maxPoolSize", //11	    "maxStatements", //12	    "maxStatementsPerConnection", //13	    "minPoolSize", //14	    "propertyCycle", //15	    "breakAfterAcquireFailure", //16	    "testConnectionOnCheckout", //17	    "testConnectionOnCheckin", //18	    "usesTraditionalReflectiveProxies", //19	    "preferredTestQuery", //20	    "automaticTestTable", //21	    "factoryClassLocation" //22	};	WRAPPER_CXN_POOL_DATA_SOURCE_OVERWRITE_PROPS = Collections.unmodifiableSet( new HashSet( Arrays.asList( props ) ) );	// As of c3p0-0.9.1	//	// This list is no longer updated, as the PoolConfig approach to setting up DataSources	// is now deprecated. (This was getting to be hard to maintain as new config properties	// were added.)	props = new String[]	{	    "numHelperThreads",	    "factoryClassLocation"	};	POOL_BACKED_DATA_SOURCE_OVERWRITE_PROPS = Collections.unmodifiableSet( new HashSet( Arrays.asList( props ) ) );    }    /**     * Defines an unpooled DataSource on the specified JDBC URL.     */    public static DataSource unpooledDataSource(String jdbcUrl) throws SQLException    { 	DriverManagerDataSource out = new DriverManagerDataSource();	out.setJdbcUrl( jdbcUrl );	return out;    }    /**     * Defines an unpooled DataSource on the specified JDBC URL, authenticating with a username and password.     */    public static DataSource unpooledDataSource(String jdbcUrl, String user, String password) throws SQLException    {	Properties props = new Properties();	props.put(SqlUtils.DRIVER_MANAGER_USER_PROPERTY, user);	props.put(SqlUtils.DRIVER_MANAGER_PASSWORD_PROPERTY, password);	return unpooledDataSource( jdbcUrl, props );     }    /**     * Defines an unpooled DataSource on the specified JDBC URL.     *     *  @param driverProps the usual DriverManager properties for your JDBC driver     *         (e.g. "user" and "password" for all drivers that support     *         authentication)     *      *  @see java.sql.DriverManager     */    public static DataSource unpooledDataSource(String jdbcUrl, Properties driverProps) throws SQLException    {	DriverManagerDataSource out = new DriverManagerDataSource();	out.setJdbcUrl( jdbcUrl );	out.setProperties( driverProps );	return out;    }    /**     * <p>Creates a pooled version of an unpooled DataSource using default configuration information.</p>     * <p><b>NOTE:</b> By default, statement pooling is turned off, because for simple databases that do     *                 not pre-parse and optimize PreparedStatements, statement caching is a net     *                 performance loss. But if your database <i>does</i> optimize PreparedStatements     *                 you'll want to turn StatementCaching on via {@link #pooledDataSource(javax.sql.DataSource, int)}.</p>     *  @return a DataSource that can be cast to a {@link PooledDataSource} if you are interested in pool statistics     */    public static DataSource pooledDataSource( DataSource unpooledDataSource ) throws SQLException    { return pooledDataSource( unpooledDataSource, null, (Map) null ); }    /**     * <p>Creates a pooled version of an unpooled DataSource using default configuration information      *    and the specified startement cache size.     *    Use a value greater than zero to turn statement caching on.</p>     *     *  @return a DataSource that can be cast to a {@link PooledDataSource} if you are interested in pool statistics     */    public static DataSource pooledDataSource( DataSource unpooledDataSource, int statement_cache_size ) throws SQLException    {// 	PoolConfig pcfg = new PoolConfig();// 	pcfg.setMaxStatements( statement_cache_size );	Map overrideProps = new HashMap();	overrideProps.put( "maxStatements", new Integer( statement_cache_size ) );	return pooledDataSource( unpooledDataSource, null, overrideProps );    }    /**     * <p>Creates a pooled version of an unpooled DataSource using configuration      *    information supplied explicitly by a {@link com.mchange.v2.c3p0.PoolConfig}.     *     *  @return a DataSource that can be cast to a {@link PooledDataSource} if you are interested in pool statistics     *     *  @deprecated if you want to set properties programmatically, please construct a ComboPooledDataSource and     *              set its properties rather than using PoolConfig     */    public static DataSource pooledDataSource( DataSource unpooledDataSource, PoolConfig pcfg ) throws SQLException    {	try	    {		WrapperConnectionPoolDataSource wcpds = new WrapperConnectionPoolDataSource();		wcpds.setNestedDataSource( unpooledDataSource );				// set PoolConfig info -- WrapperConnectionPoolDataSource properties 		BeansUtils.overwriteSpecificAccessibleProperties( pcfg, wcpds, WRAPPER_CXN_POOL_DATA_SOURCE_OVERWRITE_PROPS );				PoolBackedDataSource nascent_pbds = new PoolBackedDataSource();		nascent_pbds.setConnectionPoolDataSource( wcpds );		BeansUtils.overwriteSpecificAccessibleProperties( pcfg, nascent_pbds, POOL_BACKED_DATA_SOURCE_OVERWRITE_PROPS );		return nascent_pbds;	    }// 	catch ( PropertyVetoException e )// 	    {// 		e.printStackTrace();// 		PropertyChangeEvent evt = e.getPropertyChangeEvent();// 		throw new SQLException("Illegal value attempted for property " + evt.getPropertyName() + ": " + evt.getNewValue());// 	    } 	catch ( Exception e ) 	    { 		//e.printStackTrace();		SQLException sqle = SqlUtils.toSQLException("Exception configuring pool-backed DataSource: " + e, e);		if (Debug.DEBUG && Debug.TRACE >= Debug.TRACE_MED && logger.isLoggable( MLevel.FINE ) && e != sqle)		    logger.log( MLevel.FINE, "Converted exception to throwable SQLException", e ); 		throw sqle; 	    }    }    /*    public static DataSource pooledDataSource( DataSource unpooledDataSource, String overrideDefaultUser, String overrideDefaultPassword ) throws SQLException    {	Map overrideProps;	if (overrideDefaultUser != null)	    {		overrideProps = new HashMap();		overrideProps.put( "overrideDefaultUser", overrideDefaultUser );		overrideProps.put( "overrideDefaultPassword", overrideDefaultPassword );	    }	else	    overrideProps = null;	return pooledDataSource( unpooledDataSource, null, overrideProps );    }    */    public static DataSource pooledDataSource( DataSource unpooledDataSource, String configName ) throws SQLException    { return pooledDataSource( unpooledDataSource, configName, null ); }    public static DataSource pooledDataSource( DataSource unpooledDataSource, Map overrideProps ) throws SQLException    { return pooledDataSource( unpooledDataSource, null, overrideProps ); }    public static DataSource pooledDataSource( DataSource unpooledDataSource, String configName, Map overrideProps ) throws SQLException    {	try	    {		WrapperConnectionPoolDataSource wcpds = new WrapperConnectionPoolDataSource(configName);		wcpds.setNestedDataSource( unpooledDataSource );		if (overrideProps != null)		    BeansUtils.overwriteAccessiblePropertiesFromMap( overrideProps, 								     wcpds, 								     false,								     null,								     true,								     MLevel.WARNING,								     MLevel.WARNING,								     false);				PoolBackedDataSource nascent_pbds = new PoolBackedDataSource(configName);		nascent_pbds.setConnectionPoolDataSource( wcpds );		if (overrideProps != null)		    BeansUtils.overwriteAccessiblePropertiesFromMap( overrideProps, 								     wcpds, 								     false,								     null,								     true,								     MLevel.WARNING,								     MLevel.WARNING,								     false);		return nascent_pbds;	    }// 	catch ( PropertyVetoException e )// 	    {// 		e.printStackTrace();// 		PropertyChangeEvent evt = e.getPropertyChangeEvent();// 		throw new SQLException("Illegal value attempted for property " + evt.getPropertyName() + ": " + evt.getNewValue());// 	    } 	catch ( Exception e ) 	    { 		//e.printStackTrace();		SQLException sqle = SqlUtils.toSQLException("Exception configuring pool-backed DataSource: " + e, e);		if (Debug.DEBUG && Debug.TRACE >= Debug.TRACE_MED && logger.isLoggable( MLevel.FINE ) && e != sqle)		    logger.log( MLevel.FINE, "Converted exception to throwable SQLException", e ); 		throw sqle; 	    }    }    /**     * <p>Creates a pooled version of an unpooled DataSource using configuration      *    information supplied explicitly by a Java Properties object.</p>     *     *  @return a DataSource that can be cast to a {@link PooledDataSource} if you are interested in pool statistics     *  @see com.mchange.v2.c3p0.PoolConfig     */    public static DataSource pooledDataSource( DataSource unpooledDataSource, Properties props ) throws SQLException    { 	//return pooledDataSource( unpooledDataSource, new PoolConfig( props ) ); 	Properties peeledProps = new Properties();	for (Iterator ii = props.keySet().iterator(); ii.hasNext(); )	    {		String propKey = (String) ii.next();		String propVal = props.getProperty( propKey );		String peeledKey = (propKey.startsWith("c3p0.") ? propKey.substring(5) : propKey );		peeledProps.put( peeledKey, propVal );	    }	return pooledDataSource( unpooledDataSource, null, peeledProps );    }    /**     * <p>Immediately releases resources (Threads and database Connections) that are     *    held by a C3P0 DataSource.     *     * <p>Only DataSources created by the poolingDataSource() method hold any     *    non-memory resources. Calling this method on unpooled DataSources is     *    effectively a no-op.</p>     *     * <p>You can safely presume that destroying a pooled DataSource that is wrapped around     *    another DataSource created by this library destroys both the outer and the wrapped     *    DataSource. There is no reason to hold a reference to a nested DataSource in order     *    to explicitly destroy it.</p>     *     *  @see com.mchange.v2.c3p0.PoolConfig     */    public static void destroy( DataSource pooledDataSource ) throws SQLException    { destroy( pooledDataSource, false ); }    /**     *   @deprecated forceDestroy() is no longer meaningful, as a set of pools is now     *               directly associated with a DataSource, and not potentially shared.     *               (This simplification was made possible by canonicalization of      *               JNDI-looked-up DataSources within a virtual machine.) Just use     *               DataSources.destroy().     *     *   @see #destroy     */    public static void forceDestroy( DataSource pooledDataSource ) throws SQLException    { destroy( pooledDataSource, true ); }    private static void destroy( DataSource pooledDataSource, boolean force ) throws SQLException    {	if ( pooledDataSource instanceof PoolBackedDataSource)	    {		ConnectionPoolDataSource cpds = ((PoolBackedDataSource) pooledDataSource).getConnectionPoolDataSource();		if (cpds instanceof WrapperConnectionPoolDataSource)		    destroy( ((WrapperConnectionPoolDataSource) cpds).getNestedDataSource(), force );	    }	if ( pooledDataSource instanceof PooledDataSource )	    ((PooledDataSource) pooledDataSource).close( force );    }    private DataSources()    {}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人国产在线观看| 成人欧美一区二区三区小说 | www.视频一区| 国产一区二区伦理片| 经典三级视频一区| 久久99久久久久| 麻豆91在线播放| 免费观看成人鲁鲁鲁鲁鲁视频| 日韩影院在线观看| 日韩不卡一区二区三区| 免费国产亚洲视频| 美国十次了思思久久精品导航| 免费高清在线一区| 国内精品国产成人| 丰满岳乱妇一区二区三区| 成人午夜激情片| proumb性欧美在线观看| 91农村精品一区二区在线| 日本精品裸体写真集在线观看| 日本韩国欧美在线| 欧美精品乱码久久久久久 | 午夜视频一区二区| 久久精品国产秦先生| 国产在线视频精品一区| 国产91色综合久久免费分享| eeuss鲁片一区二区三区在线观看| 成人av第一页| 欧美日韩夫妻久久| 精品蜜桃在线看| 中日韩免费视频中文字幕| 精品无人区卡一卡二卡三乱码免费卡 | 91国偷自产一区二区三区观看 | 久久久久97国产精华液好用吗| 久久精品视频免费| 亚洲精品一卡二卡| 蜜桃av噜噜一区| 成人午夜av影视| 欧美日韩中文字幕精品| 日韩午夜精品视频| 国产精品卡一卡二卡三| 亚洲aⅴ怡春院| 国产在线播精品第三| 91丨porny丨蝌蚪视频| 91精品午夜视频| 亚洲国产精品av| 日韩精品亚洲一区二区三区免费| 国产东北露脸精品视频| 欧洲亚洲精品在线| 久久久久97国产精华液好用吗| 亚洲一区在线观看免费观看电影高清| 久久国产精品72免费观看| 不卡的av在线| 欧美大白屁股肥臀xxxxxx| 专区另类欧美日韩| 久久av资源站| 一本久久综合亚洲鲁鲁五月天 | 亚洲一区二区三区国产| 国产精品自拍网站| 欧美日韩一区二区三区不卡| 久久久一区二区| 亚洲国产综合91精品麻豆| 激情综合网激情| 欧美亚洲国产一区二区三区| 久久久久久久久久看片| 亚洲一二三四在线观看| 国产大陆精品国产| 91精品国产一区二区| 1区2区3区欧美| 国产真实乱对白精彩久久| 精品视频1区2区| 亚洲欧洲www| 国产91色综合久久免费分享| 欧美一卡二卡在线| 亚洲午夜精品久久久久久久久| 国产99久久精品| 精品成人一区二区三区| 午夜激情久久久| 在线免费观看一区| 亚洲人成人一区二区在线观看| 国产精品一卡二卡在线观看| 91精品久久久久久久99蜜桃| 亚洲欧美福利一区二区| 欧美猛男gaygay网站| 亚洲欧美色一区| 国产超碰在线一区| 337p粉嫩大胆噜噜噜噜噜91av| 日本怡春院一区二区| 欧美日韩免费在线视频| 亚洲精品自拍动漫在线| 91免费看片在线观看| 中文字幕av一区二区三区免费看| 国产一区二区伦理片| 精品美女在线播放| 久久99精品国产麻豆婷婷| 日韩三级伦理片妻子的秘密按摩| 亚洲成年人影院| 欧美日韩中文精品| 亚洲成人第一页| 欧美高清www午色夜在线视频| 一区二区在线观看免费| 91在线观看下载| 亚洲欧美在线高清| 91在线国产观看| 亚洲卡通欧美制服中文| 色香蕉成人二区免费| 一区二区三区高清在线| 在线观看视频91| 亚洲成人精品一区| 欧美日韩国产一级| 日韩成人精品视频| 日韩美女视频在线| 国产精品影视在线| 国产精品网站一区| 色偷偷成人一区二区三区91 | 亚洲成人在线观看视频| 欧美性猛交xxxx乱大交退制版 | 成人国产精品免费观看动漫| 国产日产欧美一区二区视频| 国产91精品入口| 中文字幕在线不卡一区| 91老师片黄在线观看| 亚洲综合在线观看视频| 欧美日韩精品综合在线| 日韩不卡一二三区| 久久嫩草精品久久久精品| 丰满少妇在线播放bd日韩电影| 亚洲免费av高清| 欧美日本国产视频| 狠狠网亚洲精品| 中文无字幕一区二区三区| 色综合中文字幕| 亚洲一二三四在线| 精品日本一线二线三线不卡| 国产99久久久国产精品潘金 | 性做久久久久久久免费看| 欧美福利视频导航| 国产最新精品免费| 中文字幕亚洲成人| 在线不卡一区二区| 国产精华液一区二区三区| 亚洲精品日韩一| 精品国产一二三区| 日本久久精品电影| 美女视频一区在线观看| 中文字幕精品在线不卡| 欧美视频一区二区三区| 精品亚洲免费视频| 亚洲精品欧美综合四区| 精品国产免费人成电影在线观看四季 | 精品国产乱码久久久久久老虎| 成人黄色777网| 日本视频免费一区| 国产精品九色蝌蚪自拍| 欧美精品电影在线播放| 成人免费毛片aaaaa**| 亚洲v精品v日韩v欧美v专区| 国产日本欧美一区二区| 91精品中文字幕一区二区三区| 国产成人精品一区二区三区四区 | 91国在线观看| 国产一区二区伦理| 亚洲国产视频一区二区| 久久久国际精品| 精品视频在线视频| 国产精品一区在线| 午夜av一区二区三区| 中文字幕一区免费在线观看| 欧美一区午夜视频在线观看| gogo大胆日本视频一区| 久久成人麻豆午夜电影| 亚洲综合自拍偷拍| 国产精品久久久爽爽爽麻豆色哟哟| 欧美丰满美乳xxx高潮www| 色综合欧美在线视频区| 岛国av在线一区| 久久97超碰国产精品超碰| 亚洲国产精品天堂| 亚洲人一二三区| 日本一区二区三区高清不卡| 欧美一级久久久| 欧美色国产精品| 91蝌蚪porny九色| 丁香婷婷综合激情五月色| 蜜臀av性久久久久蜜臀aⅴ四虎| 一区二区久久久久久| 中文字幕一区不卡| 国产午夜精品一区二区三区嫩草| 欧美高清dvd| 欧美区一区二区三区| 91久久精品午夜一区二区| 成人动漫一区二区在线| 国产乱子轮精品视频| 精品一区二区免费视频| 日本一不卡视频| 午夜精品久久久久久| 有码一区二区三区| 亚洲日本va午夜在线影院| 亚洲免费观看高清完整版在线| 国产精品久久夜| 亚洲国产成人私人影院tom|