Package play.db
Class DB
java.lang.Object
play.db.DB
Database connection utilities.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic DataSourceDeprecated.Use dataSources insteadprotected static final Map<String,DB.ExtendedDatasource> The loaded datasource.static final Stringstatic StringDeprecated.Use dataSources instead -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose()Close all the open connections for the current thread.static voidClose a given open connections for the current threadstatic voidcloseAll()Close all the open connections for the current thread.static voidDestroy the datasourcestatic voidDestroy all dataSourcesstatic voidstatic voidstatic DataSourcestatic DataSourcegetDataSource(String name) static Map<String,DataSource>
-
Field Details
-
dataSources
The loaded datasource.- See Also:
-
dataSource
Deprecated.Use dataSources instead- Since:
- 1.3.0
- See Also:
-
destroyMethod
Deprecated.Use dataSources insteadThe method used to destroy the datasource- Since:
- 1.3.0
- See Also:
-
DEFAULT
- See Also:
-
-
Constructor Details
-
DB
public DB()
-
-
Method Details
-
getDataSource
-
getDataSource
-
getDataSources
-
closeAll
public static void closeAll()Close all the open connections for the current thread. -
close
public static void close()Close all the open connections for the current thread. -
close
Close a given open connections for the current thread- Parameters:
name- Name of the DB
-
execute
-
execute
-
destroy
Destroy the datasource- Parameters:
name- the DB name
-
destroyAll
public static void destroyAll()Destroy all dataSources
-