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

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

?? c3p0configutils.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.cfg;import java.io.*;import java.lang.reflect.*;import java.util.*;import javax.xml.parsers.*;import org.w3c.dom.*;import com.mchange.v2.cfg.*;import com.mchange.v2.log.*;import com.mchange.v2.c3p0.impl.*;import com.mchange.v1.xml.DomParseUtils;public final class C3P0ConfigUtils{    public final static String XML_CONFIG_RSRC_PATH     = "/c3p0-config.xml";    public final static String PROPS_FILE_RSRC_PATH     = "/c3p0.properties";    public final static String PROPS_FILE_PROP_PFX      = "c3p0.";    public final static int    PROPS_FILE_PROP_PFX_LEN  = 5;    public final static String LINESEP;    static    {	String ls;	try	    { ls = System.getProperty("line.separator", "\r\n"); }	catch (Exception e)	    { ls = "\r\n"; }	LINESEP = ls;    }        final static MLogger logger = MLog.getLogger( C3P0ConfigUtils.class );//     final static HashSet extractHardcodedC3P0PropertyNames()//     {// 	HashSet out = new HashSet();// 	try// 	    {// 		Method[] methods = C3P0Defaults.class.getMethods();// 		for (int i = 0, len = methods.length; i < len; ++i)// 		    {// 			Method m = methods[i];// 			int mods = m.getModifiers();// 			if ((mods & Modifier.PUBLIC) != 0 && (mods & Modifier.STATIC) != 0 && m.getParameterTypes().length == 0)// 			    out.add( m.getName() );// 		    }// 	    }// 	catch (Exception e)// 	    {// 		logger.log( MLevel.WARNING, "Failed to extract hardcoded property names!?", e );// 	    }	// 	return out;//     }    public static HashMap extractHardcodedC3P0Defaults(boolean stringify)    {	HashMap out = new HashMap();	try	    {		Method[] methods = C3P0Defaults.class.getMethods();		for (int i = 0, len = methods.length; i < len; ++i)		    {			Method m = methods[i];			int mods = m.getModifiers();			if ((mods & Modifier.PUBLIC) != 0 && (mods & Modifier.STATIC) != 0 && m.getParameterTypes().length == 0)			    {				if (stringify)				    {					Object val = m.invoke( null, null );					if ( val != null )					    out.put( m.getName(), String.valueOf( val ) );				    }				else				    out.put( m.getName(), m.invoke( null, null ) );			    }		    }	    }	catch (Exception e)	    {		logger.log( MLevel.WARNING, "Failed to extract hardcoded default config!?", e );	    }	return out;    }    public static HashMap extractHardcodedC3P0Defaults()    { return extractHardcodedC3P0Defaults( true ); }    public static HashMap extractC3P0PropertiesResources()    {	HashMap out = new HashMap();// 	Properties props = findResourceProperties();// 	props.putAll( findAllC3P0Properties() ); 	Properties props = findAllC3P0Properties();	for (Iterator ii = props.keySet().iterator(); ii.hasNext(); )	    {		String key = (String) ii.next();		String val = (String) props.get(key);		if ( key.startsWith(PROPS_FILE_PROP_PFX) )		    out.put( key.substring(PROPS_FILE_PROP_PFX_LEN).trim(), val.trim() );	    }	return out;    }    public static C3P0Config extractXmlConfigFromDefaultResource() throws Exception    {	InputStream is = null;	try	    {		is = C3P0ConfigUtils.class.getResourceAsStream(XML_CONFIG_RSRC_PATH);		return (is == null ? null : extractXmlConfigFromInputStream( is ));	    }	finally	    {		try { if (is != null) is.close(); }		catch (Exception e)		    {			if ( logger.isLoggable( MLevel.FINE ) )			    logger.log(MLevel.FINE,"Exception on resource InputStream close.", e);		    }	    }    }    public static C3P0Config extractXmlConfigFromInputStream(InputStream is) throws Exception    {	DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();	DocumentBuilder db = fact.newDocumentBuilder();	Document doc = db.parse( is );	return extractConfigFromXmlDoc(doc);    }    public static C3P0Config extractConfigFromXmlDoc(Document doc) throws Exception    {	Element docElem = doc.getDocumentElement();	if (docElem.getTagName().equals("c3p0-config"))	    {		NamedScope defaults;		HashMap configNamesToNamedScopes = new HashMap();		Element defaultConfigElem = DomParseUtils.uniqueChild( docElem, "default-config" );		if (defaultConfigElem != null)		    defaults = extractNamedScopeFromLevel( defaultConfigElem );		else		    defaults = new NamedScope();		NodeList nl = DomParseUtils.immediateChildElementsByTagName(docElem, "named-config");		for (int i = 0, len = nl.getLength(); i < len; ++i)		    {			Element namedConfigElem = (Element) nl.item(i);			String configName = namedConfigElem.getAttribute("name");			if (configName != null && configName.length() > 0)			    {				NamedScope namedConfig = extractNamedScopeFromLevel( namedConfigElem );				configNamesToNamedScopes.put( configName, namedConfig);			    }			else			    logger.warning("Configuration XML contained named-config element without name attribute: " + namedConfigElem);		    }		return new C3P0Config( defaults, configNamesToNamedScopes );	    }	else	    throw new Exception("Root element of c3p0 config xml should be 'c3p0-config', not '" + docElem.getTagName() + "'.");    }    public static C3P0Config configFromFlatDefaults(HashMap flatDefaults)    {	NamedScope defaults = new NamedScope();	defaults.props.putAll( flatDefaults );		HashMap configNamesToNamedScopes = new HashMap();		return new C3P0Config( defaults, configNamesToNamedScopes );     }    private static NamedScope extractNamedScopeFromLevel(Element elem)    {	HashMap props = extractPropertiesFromLevel( elem );	HashMap userNamesToOverrides = new HashMap();	NodeList nl = DomParseUtils.immediateChildElementsByTagName(elem, "user-overrides");	for (int i = 0, len = nl.getLength(); i < len; ++i)	    {		Element perUserConfigElem = (Element) nl.item(i);		String userName = perUserConfigElem.getAttribute("user");		if (userName != null && userName.length() > 0)		    {			HashMap userProps = extractPropertiesFromLevel( perUserConfigElem );			userNamesToOverrides.put( userName, userProps );		    }		else		    logger.warning("Configuration XML contained user-overrides element without user attribute: " + LINESEP + perUserConfigElem);	    }	return new NamedScope(props, userNamesToOverrides);    }    private static HashMap extractPropertiesFromLevel(Element elem)    {	// System.err.println( "extractPropertiesFromLevel()" );	HashMap out = new HashMap();	try	    {		NodeList nl = DomParseUtils.immediateChildElementsByTagName(elem, "property");		int len = nl.getLength();		for (int i = 0; i < len; ++i)		    {			Element propertyElem = (Element) nl.item(i);			String propName = propertyElem.getAttribute("name");			if (propName != null && propName.length() > 0)			    {				String propVal = DomParseUtils.allTextFromElement(propertyElem, true);				out.put( propName, propVal );				//System.err.println( propName + " -> " + propVal );			    }			else			    logger.warning("Configuration XML contained property element without name attribute: " + LINESEP + propertyElem);		    }	    }	catch (Exception e)	    {		logger.log( MLevel.WARNING, 			    "An exception occurred while reading config XML. " +			    "Some configuration information has probably been ignored.", 			    e );	    }	return out;    }    private static Properties findResourceProperties()    { return MultiPropertiesConfig.readVmConfig().getPropertiesByResourcePath(PROPS_FILE_RSRC_PATH); }    private static Properties findAllC3P0Properties()    { return MultiPropertiesConfig.readVmConfig().getPropertiesByPrefix("c3p0"); }    static Properties findAllC3P0SystemProperties()    {	Properties out = new Properties();	SecurityException sampleExc = null;	try	    {		for (Iterator ii = C3P0Defaults.getKnownProperties().iterator(); ii.hasNext(); )		    {			String key = (String) ii.next();			String prefixedKey = "c3p0." + key;			String value = System.getProperty( prefixedKey );			if (value != null && value.trim().length() > 0)			    out.put( key, value );		    }	    }	catch (SecurityException e)	    { sampleExc = e; }	return out;    }    private C3P0ConfigUtils()    {}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久毛片高清国产| 91久久线看在观草草青青| 色综合天天综合狠狠| 久久久精品免费观看| 日韩精品电影一区亚洲| 在线观看av不卡| 一区二区三区中文字幕电影 | 97精品久久久午夜一区二区三区 | 欧美福利一区二区| 香蕉乱码成人久久天堂爱免费| 欧洲精品一区二区三区在线观看| 最新热久久免费视频| 国产成人精品亚洲午夜麻豆| 日韩一级在线观看| 免费观看久久久4p| 精品久久久久一区二区国产| 久久精品国产网站| 久久久久青草大香线综合精品| 国产曰批免费观看久久久| 久久众筹精品私拍模特| 国产精品一区不卡| 国产日韩在线不卡| 东方欧美亚洲色图在线| 中文天堂在线一区| 91同城在线观看| 亚洲一区二区不卡免费| 欧美日韩视频不卡| 国内精品久久久久影院色| 国产蜜臀av在线一区二区三区 | 国产精品自在欧美一区| 国产嫩草影院久久久久| 色婷婷综合久久| 日日夜夜一区二区| 日韩三级在线免费观看| 日本一不卡视频| 国产视频一区二区三区在线观看| av在线播放成人| 亚洲电影一区二区三区| 日韩欧美一区在线| 成人激情午夜影院| 亚洲国产中文字幕在线视频综合 | 久久久国产精华| 99精品欧美一区二区蜜桃免费| 一区二区三区久久| 日韩美女在线视频| 99久久综合99久久综合网站| 一区二区三区国产豹纹内裤在线| 日韩一区二区免费视频| 99久免费精品视频在线观看| 午夜欧美2019年伦理| 欧美v日韩v国产v| 国产成a人无v码亚洲福利| 亚洲午夜电影在线观看| 国产亚洲一区二区三区在线观看 | 国产一区二区精品在线观看| 亚洲欧美乱综合| 欧美一区二区大片| 91在线云播放| 激情五月激情综合网| 依依成人综合视频| 日韩美女视频一区二区在线观看| 国产精品一二三区| 调教+趴+乳夹+国产+精品| 国产精品美女久久久久久2018| 欧美日韩高清不卡| 91婷婷韩国欧美一区二区| 久久99久久久欧美国产| 亚洲影院理伦片| 中文一区二区完整视频在线观看| 在线播放欧美女士性生活| 丁香一区二区三区| 麻豆久久久久久久| 亚洲香蕉伊在人在线观| **网站欧美大片在线观看| 久久久久国产免费免费| 日韩一区二区三区视频| 欧美色欧美亚洲另类二区| 99精品桃花视频在线观看| 国产精品主播直播| 美国十次了思思久久精品导航| 亚洲人成在线播放网站岛国| 日韩欧美在线不卡| 777亚洲妇女| 欧美精品日韩精品| 欧美精选一区二区| 欧美日本一区二区| 欧美日韩午夜影院| 欧美精品在线视频| 欧美伊人久久大香线蕉综合69| 国产精品88av| 免费日本视频一区| 蜜桃传媒麻豆第一区在线观看| 石原莉奈在线亚洲三区| 香蕉乱码成人久久天堂爱免费| 一区二区三区欧美激情| 亚洲精品网站在线观看| 亚洲色欲色欲www| 中文字幕一区二区三中文字幕 | 678五月天丁香亚洲综合网| 色综合天天综合给合国产| av电影一区二区| 成人app软件下载大全免费| 国产成人av资源| 国产福利一区在线| jizz一区二区| 日本韩国欧美一区二区三区| 99re成人在线| 色天使色偷偷av一区二区| 在线视频一区二区三区| 欧美性三三影院| 成人黄色免费短视频| 国产精品主播直播| 成人午夜电影久久影院| 99久久99精品久久久久久 | 99久久伊人网影院| 99视频热这里只有精品免费| 日本高清免费不卡视频| 欧美日韩一级大片网址| 8x8x8国产精品| 欧美一级精品在线| 久久精品日产第一区二区三区高清版| 欧美国产在线观看| 亚洲综合丝袜美腿| 日韩精品一级中文字幕精品视频免费观看 | 久久亚洲一级片| 国产欧美日本一区二区三区| 亚洲乱码国产乱码精品精的特点| 亚洲一区二区三区四区在线观看 | 日本电影亚洲天堂一区| 欧美日韩国产一级| 制服丝袜亚洲网站| 亚洲精品在线三区| 国产精品无圣光一区二区| 亚洲成在人线在线播放| 国产一区二区三区免费看| 91女厕偷拍女厕偷拍高清| 337p亚洲精品色噜噜| 国产精品进线69影院| 午夜精品久久久久| 成人av电影在线观看| 欧美另类变人与禽xxxxx| 日韩情涩欧美日韩视频| 日本一二三四高清不卡| 亚洲大片在线观看| 成人免费不卡视频| 911精品国产一区二区在线| 国产精品久久久久久亚洲毛片 | 亚洲人成在线播放网站岛国| 精品一区在线看| 欧美色国产精品| 一区二区三区精密机械公司| 国产精品一区二区久久不卡 | 欧美一区二区三区思思人| 亚洲视频一区在线| 成人午夜私人影院| 26uuu另类欧美亚洲曰本| 日韩国产一二三区| 欧美麻豆精品久久久久久| 亚洲精品国产无天堂网2021| av一二三不卡影片| 国产精品灌醉下药二区| 丁香天五香天堂综合| 久久日韩粉嫩一区二区三区| 久久99精品国产麻豆婷婷洗澡| 欧美日韩高清在线播放| 丝瓜av网站精品一区二区| 欧美亚洲图片小说| 一区二区在线看| 日本精品视频一区二区| 亚洲精品国产精品乱码不99| 一本一本大道香蕉久在线精品| 欧美激情在线看| 成人综合婷婷国产精品久久蜜臀| 久久精品亚洲麻豆av一区二区 | 国产精品一区久久久久| 精品国产区一区| 国产裸体歌舞团一区二区| 久久精品日产第一区二区三区高清版 | 欧美日韩mp4| 日本视频在线一区| 精品噜噜噜噜久久久久久久久试看| 狠狠狠色丁香婷婷综合激情| 国产午夜三级一区二区三| 国产99久久久国产精品潘金网站| 国产欧美日韩综合精品一区二区| 成人午夜私人影院| 一区二区三区久久久| 日韩一级片网站| 国产福利精品导航| 亚洲视频资源在线| 欧美精品三级在线观看| 精品一区精品二区高清| 国产精品三级久久久久三级| 色呦呦网站一区| 蜜桃91丨九色丨蝌蚪91桃色| 精品日韩欧美在线| 不卡视频一二三四| 亚洲v日本v欧美v久久精品| 精品国产制服丝袜高跟| a亚洲天堂av|