Package play.db
Class DB
java.lang.Object
play.db.DB
Database connection utilities.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic @Nullable DataSourceDeprecated.Use dataSources insteadstatic 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 @Nullable DataSourcegetDataSource(String name) static Map<String,DataSource>
-
Field Details
-
dataSource
Deprecated.Use dataSources instead- Since:
- 1.3.0
- See Also:
-
dataSourcesDB.ExtendedDatasource
-
destroyMethod
Deprecated.Use dataSources insteadThe method used to destroy the datasource- Since:
- 1.3.0
- See Also:
-
dataSourcesDB.ExtendedDatasource
-
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
-