com.alibaba.druid.pool
Class DruidDataSourceFactory

java.lang.Object
  extended by com.alibaba.druid.pool.DruidDataSourceFactory
All Implemented Interfaces:
ObjectFactory

public class DruidDataSourceFactory
extends Object
implements ObjectFactory


Field Summary
static String PROP_ACCESSTOUNDERLYINGCONNECTIONALLOWED
           
static String PROP_CONNECTIONPROPERTIES
           
static String PROP_DEFAULTAUTOCOMMIT
           
static String PROP_DEFAULTCATALOG
           
static String PROP_DEFAULTREADONLY
           
static String PROP_DEFAULTTRANSACTIONISOLATION
           
static String PROP_DRIVERCLASSNAME
           
static String PROP_EXCEPTION_SORTER
           
static String PROP_EXCEPTION_SORTER_CLASS_NAME
           
static String PROP_FILTERS
           
static String PROP_INIT
           
static String PROP_INITCONNECTIONSQLS
           
static String PROP_INITIALSIZE
           
static String PROP_LOGABANDONED
           
static String PROP_MAXACTIVE
           
static String PROP_MAXIDLE
           
static String PROP_MAXOPENPREPAREDSTATEMENTS
           
static String PROP_MAXWAIT
           
static String PROP_MINEVICTABLEIDLETIMEMILLIS
           
static String PROP_MINIDLE
           
static String PROP_NUMTESTSPEREVICTIONRUN
           
static String PROP_PASSWORD
           
static String PROP_POOLPREPAREDSTATEMENTS
           
static String PROP_REMOVEABANDONED
           
static String PROP_REMOVEABANDONEDTIMEOUT
           
static String PROP_TESTONBORROW
           
static String PROP_TESTONRETURN
           
static String PROP_TESTWHILEIDLE
           
static String PROP_TIMEBETWEENEVICTIONRUNSMILLIS
           
static String PROP_URL
           
static String PROP_USERNAME
           
static String PROP_VALIDATIONQUERY
           
static String PROP_VALIDATIONQUERY_TIMEOUT
           
 
Constructor Summary
DruidDataSourceFactory()
           
 
Method Summary
static void config(DruidDataSource dataSource, Map properties)
           
static DataSource createDataSource(Map properties)
           
static DataSource createDataSource(Properties properties)
           
 Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_DEFAULTAUTOCOMMIT

public static final String PROP_DEFAULTAUTOCOMMIT
See Also:
Constant Field Values

PROP_DEFAULTREADONLY

public static final String PROP_DEFAULTREADONLY
See Also:
Constant Field Values

PROP_DEFAULTTRANSACTIONISOLATION

public static final String PROP_DEFAULTTRANSACTIONISOLATION
See Also:
Constant Field Values

PROP_DEFAULTCATALOG

public static final String PROP_DEFAULTCATALOG
See Also:
Constant Field Values

PROP_DRIVERCLASSNAME

public static final String PROP_DRIVERCLASSNAME
See Also:
Constant Field Values

PROP_MAXACTIVE

public static final String PROP_MAXACTIVE
See Also:
Constant Field Values

PROP_MAXIDLE

public static final String PROP_MAXIDLE
See Also:
Constant Field Values

PROP_MINIDLE

public static final String PROP_MINIDLE
See Also:
Constant Field Values

PROP_INITIALSIZE

public static final String PROP_INITIALSIZE
See Also:
Constant Field Values

PROP_MAXWAIT

public static final String PROP_MAXWAIT
See Also:
Constant Field Values

PROP_TESTONBORROW

public static final String PROP_TESTONBORROW
See Also:
Constant Field Values

PROP_TESTONRETURN

public static final String PROP_TESTONRETURN
See Also:
Constant Field Values

PROP_TIMEBETWEENEVICTIONRUNSMILLIS

public static final String PROP_TIMEBETWEENEVICTIONRUNSMILLIS
See Also:
Constant Field Values

PROP_NUMTESTSPEREVICTIONRUN

public static final String PROP_NUMTESTSPEREVICTIONRUN
See Also:
Constant Field Values

PROP_MINEVICTABLEIDLETIMEMILLIS

public static final String PROP_MINEVICTABLEIDLETIMEMILLIS
See Also:
Constant Field Values

PROP_TESTWHILEIDLE

public static final String PROP_TESTWHILEIDLE
See Also:
Constant Field Values

PROP_PASSWORD

public static final String PROP_PASSWORD
See Also:
Constant Field Values

PROP_URL

public static final String PROP_URL
See Also:
Constant Field Values

PROP_USERNAME

public static final String PROP_USERNAME
See Also:
Constant Field Values

PROP_VALIDATIONQUERY

public static final String PROP_VALIDATIONQUERY
See Also:
Constant Field Values

PROP_VALIDATIONQUERY_TIMEOUT

public static final String PROP_VALIDATIONQUERY_TIMEOUT
See Also:
Constant Field Values

PROP_INITCONNECTIONSQLS

public static final String PROP_INITCONNECTIONSQLS
See Also:
Constant Field Values

PROP_ACCESSTOUNDERLYINGCONNECTIONALLOWED

public static final String PROP_ACCESSTOUNDERLYINGCONNECTIONALLOWED
See Also:
Constant Field Values

PROP_REMOVEABANDONED

public static final String PROP_REMOVEABANDONED
See Also:
Constant Field Values

PROP_REMOVEABANDONEDTIMEOUT

public static final String PROP_REMOVEABANDONEDTIMEOUT
See Also:
Constant Field Values

PROP_LOGABANDONED

public static final String PROP_LOGABANDONED
See Also:
Constant Field Values

PROP_POOLPREPAREDSTATEMENTS

public static final String PROP_POOLPREPAREDSTATEMENTS
See Also:
Constant Field Values

PROP_MAXOPENPREPAREDSTATEMENTS

public static final String PROP_MAXOPENPREPAREDSTATEMENTS
See Also:
Constant Field Values

PROP_CONNECTIONPROPERTIES

public static final String PROP_CONNECTIONPROPERTIES
See Also:
Constant Field Values

PROP_FILTERS

public static final String PROP_FILTERS
See Also:
Constant Field Values

PROP_EXCEPTION_SORTER

public static final String PROP_EXCEPTION_SORTER
See Also:
Constant Field Values

PROP_EXCEPTION_SORTER_CLASS_NAME

public static final String PROP_EXCEPTION_SORTER_CLASS_NAME
See Also:
Constant Field Values

PROP_INIT

public static final String PROP_INIT
See Also:
Constant Field Values
Constructor Detail

DruidDataSourceFactory

public DruidDataSourceFactory()
Method Detail

getObjectInstance

public Object getObjectInstance(Object obj,
                                Name name,
                                Context nameCtx,
                                Hashtable<?,?> environment)
                         throws Exception
Specified by:
getObjectInstance in interface ObjectFactory
Throws:
Exception

createDataSource

public static DataSource createDataSource(Properties properties)
                                   throws Exception
Throws:
Exception

createDataSource

public static DataSource createDataSource(Map properties)
                                   throws Exception
Throws:
Exception

config

public static void config(DruidDataSource dataSource,
                          Map properties)
                   throws SQLException
Throws:
SQLException


Copyright © 2012 Alibaba Group. All Rights Reserved.