Package play.db

Class DB

java.lang.Object
play.db.DB

@NullMarked @CheckReturnValue public class DB extends Object
Database connection utilities.
  • Field Details

  • Constructor Details

    • DB

      public DB()
  • Method Details

    • getDataSource

      public static @Nullable DataSource getDataSource(String name)
    • getDataSource

      public static DataSource getDataSource()
    • getDataSources

      public static Map<String,DataSource> 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

      public static void close(String name)
      Close a given open connections for the current thread
      Parameters:
      name - Name of the DB
    • execute

      public static void execute(String SQL)
    • execute

      public static void execute(String name, String sql)
    • destroy

      public static void destroy(String name)
      Destroy the datasource
      Parameters:
      name - the DB name
    • destroyAll

      public static void destroyAll()
      Destroy all dataSources