play.db
Class DB

java.lang.Object
  extended by play.db.DB

public class DB
extends java.lang.Object

Provides a high-level API for getting JDBC connections.


Constructor Summary
DB()
           
 
Method Summary
static java.sql.Connection getConnection()
          Returns a connection from the default datasource, with auto-commit enabled.
static java.sql.Connection getConnection(boolean autocommit)
          Returns a connection from the default datasource, with the specified auto-commit setting.
static java.sql.Connection getConnection(java.lang.String database)
          Returns a connection from any datasource, with auto-commit enabled.
static java.sql.Connection getConnection(java.lang.String database, boolean autocommit)
          Get a connection from any datasource, with the specified auto-commit setting.
static javax.sql.DataSource getDataSource()
          Returns the default datasource.
static javax.sql.DataSource getDataSource(java.lang.String database)
          Returns any default datasource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DB

public DB()
Method Detail

getDataSource

public static javax.sql.DataSource getDataSource()
Returns the default datasource.


getDataSource

public static javax.sql.DataSource getDataSource(java.lang.String database)
Returns any default datasource.


getConnection

public static java.sql.Connection getConnection()
Returns a connection from the default datasource, with auto-commit enabled.


getConnection

public static java.sql.Connection getConnection(boolean autocommit)
Returns a connection from the default datasource, with the specified auto-commit setting.


getConnection

public static java.sql.Connection getConnection(java.lang.String database)
Returns a connection from any datasource, with auto-commit enabled.


getConnection

public static java.sql.Connection getConnection(java.lang.String database,
                                                boolean autocommit)
Get a connection from any datasource, with the specified auto-commit setting.