public class DataSources extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
DATASOURCE_IMPLEMENT_KEY_C3P0 |
static String |
DATASOURCE_IMPLEMENT_KEY_DBCP2 |
static String |
DATASOURCE_IMPLEMENT_KEY_DRUID |
static String |
DATASOURCE_IMPLEMENT_KEY_HIKARICP |
static String |
DATASOURCE_IMPLEMENT_KEY_TOMCAT |
static String |
DATASOURCE_NAME_WILDCARD |
static DataSourceKey |
DATASOURCE_PRIMARY |
static String |
DATASOURCE_PRIMARY_GROUP |
static String |
DATASOURCE_PRIMARY_NAME |
static String |
DATASOURCE_PROP_GROUP |
static String |
DATASOURCE_PROP_IMPLEMENTATION |
static String |
DATASOURCE_PROP_NAME |
| 构造器和说明 |
|---|
DataSources() |
| 限定符和类型 | 方法和说明 |
|---|---|
static DataSourceKey |
buildDataSourceKey(String idString) |
static void |
doCloseConnection(Connection con,
DataSource dataSource)
Close the Connection, unless a
SmartDataSource doesn't want us to. |
static void |
doReleaseConnection(Connection con,
DataSource dataSource)
Actually close the given Connection, obtained from the given DataSource.
|
static String |
getDatasourceIdSeparator() |
static boolean |
isImplementationKeyMatched(String expectedKey,
DataSourceProperties properties) |
static void |
releaseConnection(Connection con,
DataSource dataSource)
Close the given Connection, obtained from the given DataSource,
if it is not managed externally (that is, not bound to the thread).
|
static NamedDataSource |
toNamedDataSource(DataSource dataSource) |
static NamedDataSource |
toNamedDataSource(DataSource dataSource,
DataSourceKey dataSourceKey,
DataSourceProperties dataSourceProperties) |
static NamedDataSource |
toNamedDataSource(DataSource delegate,
String name,
DataSourceProperties dataSourceProperties) |
static NamedDataSource |
toNamedDataSource(DataSource delegate,
String group,
String name,
DataSourceProperties dataSourceProperties) |
public static final String DATASOURCE_IMPLEMENT_KEY_TOMCAT
public static final String DATASOURCE_IMPLEMENT_KEY_HIKARICP
public static final String DATASOURCE_IMPLEMENT_KEY_DRUID
public static final String DATASOURCE_IMPLEMENT_KEY_DBCP2
public static final String DATASOURCE_PROP_IMPLEMENTATION
public static final DataSourceKey DATASOURCE_PRIMARY
public static void releaseConnection(Connection con, DataSource dataSource)
con - the Connection to close if necessary
(if this is null, the call will be ignored)dataSource - the DataSource that the Connection was obtained from
(may be null)public static void doReleaseConnection(Connection con, DataSource dataSource) throws SQLException
releaseConnection(java.sql.Connection, javax.sql.DataSource), but throwing the original SQLException.con - the Connection to close if necessary
(if this is null, the call will be ignored)dataSource - the DataSource that the Connection was obtained from
(may be null)SQLException - if thrown by JDBC methodspublic static void doCloseConnection(Connection con, DataSource dataSource) throws SQLException
SmartDataSource doesn't want us to.con - the Connection to close if necessarydataSource - the DataSource that the Connection was obtained fromSQLException - if thrown by JDBC methodsConnection.close(),
SmartDataSource.shouldClose(Connection)public static boolean isImplementationKeyMatched(@NonNull
String expectedKey,
DataSourceProperties properties)
public static String getDatasourceIdSeparator()
public static NamedDataSource toNamedDataSource(DataSource dataSource)
public static NamedDataSource toNamedDataSource(@NonNull DataSource delegate, String name, DataSourceProperties dataSourceProperties)
public static NamedDataSource toNamedDataSource(DataSource dataSource, DataSourceKey dataSourceKey, DataSourceProperties dataSourceProperties)
public static NamedDataSource toNamedDataSource(@NonNull DataSource delegate, @Nullable String group, @NonNull String name, DataSourceProperties dataSourceProperties)
public static DataSourceKey buildDataSourceKey(String idString)
Copyright © 2021. All rights reserved.