@Deprecated
public final class DB
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <A> scala.runtime.AbstractFunction1<java.sql.Connection,A> |
connectionFunction(ConnectionCallable<A> block)
Deprecated.
Create a Scala function wrapper for ConnectionCallable.
|
static scala.runtime.AbstractFunction1<java.sql.Connection,scala.runtime.BoxedUnit> |
connectionFunction(ConnectionRunnable block)
Deprecated.
Create a Scala function wrapper for ConnectionRunnable.
|
static java.sql.Connection |
getConnection()
Deprecated.
Returns a connection from the default datasource,
with auto-commit enabled.
|
static java.sql.Connection |
getConnection(boolean autocommit)
Deprecated.
Returns a connection from the default datasource,
with the specified auto-commit setting.
|
static java.sql.Connection |
getConnection(java.lang.String name)
Deprecated.
Returns a connection from any datasource, with auto-commit enabled.
|
static java.sql.Connection |
getConnection(java.lang.String name,
boolean autocommit)
Deprecated.
Get a connection from any datasource,
with the specified auto-commit setting.
|
static javax.sql.DataSource |
getDataSource()
Deprecated.
|
static javax.sql.DataSource |
getDataSource(java.lang.String name)
Deprecated.
Returns specified database.
|
static <A> A |
withConnection(boolean autocommit,
ConnectionCallable<A> block)
Deprecated.
Executes a block of code, providing a JDBC connection.
|
static <A> A |
withConnection(boolean autocommit,
ConnectionCallable<A> block,
play.api.Application application)
Deprecated.
Executes a block of code, providing a JDBC connection.
|
static void |
withConnection(boolean autocommit,
ConnectionRunnable block)
Deprecated.
Executes a block of code, providing a JDBC connection.
|
static void |
withConnection(boolean autocommit,
ConnectionRunnable block,
play.api.Application application)
Deprecated.
Executes a block of code, providing a JDBC connection.
|
static <A> A |
withConnection(ConnectionCallable<A> block)
Deprecated.
Execute a block of code, providing a JDBC connection.
|
static <A> A |
withConnection(ConnectionCallable<A> block,
play.api.Application application)
Deprecated.
Execute a block of code, providing a JDBC connection.
|
static void |
withConnection(ConnectionRunnable block)
Deprecated.
Execute a block of code, providing a JDBC connection.
|
static void |
withConnection(ConnectionRunnable block,
play.api.Application application)
Deprecated.
Execute a block of code, providing a JDBC connection.
|
static <A> A |
withConnection(java.lang.String name,
boolean autocommit,
ConnectionCallable<A> block)
Deprecated.
Executes a block of code, providing a JDBC connection.
|
static <A> A |
withConnection(java.lang.String name,
boolean autocommit,
ConnectionCallable<A> block,
play.api.Application application)
Deprecated.
Executes a block of code, providing a JDBC connection.
|
static void |
withConnection(java.lang.String name,
boolean autocommit,
ConnectionRunnable block)
Deprecated.
Executes a block of code, providing a JDBC connection.
|
static void |
withConnection(java.lang.String name,
boolean autocommit,
ConnectionRunnable block,
play.api.Application application)
Deprecated.
Executes a block of code, providing a JDBC connection.
|
static <A> A |
withConnection(java.lang.String name,
ConnectionCallable<A> block)
Deprecated.
Executes a block of code, providing a JDBC connection.
|
static <A> A |
withConnection(java.lang.String name,
ConnectionCallable<A> block,
play.api.Application application)
Deprecated.
Executes a block of code, providing a JDBC connection.
|
static void |
withConnection(java.lang.String name,
ConnectionRunnable block)
Deprecated.
Executes a block of code, providing a JDBC connection.
|
static void |
withConnection(java.lang.String name,
ConnectionRunnable block,
play.api.Application application)
Deprecated.
Executes a block of code, providing a JDBC connection.
|
static <A> A |
withTransaction(ConnectionCallable<A> block)
Deprecated.
Execute a block of code, in the scope of a JDBC transaction.
|
static <A> A |
withTransaction(ConnectionCallable<A> block,
play.api.Application application)
Deprecated.
Execute a block of code, in the scope of a JDBC transaction.
|
static void |
withTransaction(ConnectionRunnable block)
Deprecated.
Execute a block of code, in the scope of a JDBC transaction.
|
static void |
withTransaction(ConnectionRunnable block,
play.api.Application application)
Deprecated.
Execute a block of code, in the scope of a JDBC transaction.
|
static <A> A |
withTransaction(java.lang.String name,
ConnectionCallable<A> block)
Deprecated.
Execute a block of code, in the scope of a JDBC transaction.
|
static <A> A |
withTransaction(java.lang.String name,
ConnectionCallable<A> block,
play.api.Application application)
Deprecated.
Execute a block of code, in the scope of a JDBC transaction.
|
static void |
withTransaction(java.lang.String name,
ConnectionRunnable block)
Deprecated.
Execute a block of code, in the scope of a JDBC transaction.
|
static void |
withTransaction(java.lang.String name,
ConnectionRunnable block,
play.api.Application application)
Deprecated.
Execute a block of code, in the scope of a JDBC transaction.
|
public static javax.sql.DataSource getDataSource()
public static javax.sql.DataSource getDataSource(java.lang.String name)
name
- Datasource namepublic static java.sql.Connection getConnection()
public static java.sql.Connection getConnection(boolean autocommit)
autocommit
- true if the returned Connection should have autocommit enabledpublic static java.sql.Connection getConnection(java.lang.String name)
name
- Datasource namepublic static java.sql.Connection getConnection(java.lang.String name, boolean autocommit)
name
- Datasource nameautocommit
- Auto-commit settingpublic static void withConnection(java.lang.String name, boolean autocommit, ConnectionRunnable block, play.api.Application application)
name
- Datasource nameautocommit
- Auto-commit settingblock
- Code block to executeapplication
- Play application (play.api.Play.unsafeApplication())public static void withConnection(java.lang.String name, ConnectionRunnable block, play.api.Application application)
name
- Datasource nameblock
- Code block to executeapplication
- Play application (play.api.Play.unsafeApplication())public static void withConnection(boolean autocommit, ConnectionRunnable block, play.api.Application application)
autocommit
- Auto-commit settingblock
- Code block to executeapplication
- Play application (play.api.Play.unsafeApplication())public static void withConnection(ConnectionRunnable block, play.api.Application application)
block
- Code block to executeapplication
- Play application (play.api.Play.unsafeApplication())public static void withConnection(java.lang.String name, boolean autocommit, ConnectionRunnable block)
name
- Datasource nameautocommit
- Auto-commit settingblock
- Code block to executepublic static void withConnection(java.lang.String name, ConnectionRunnable block)
name
- Datasource nameblock
- Code block to executepublic static void withConnection(boolean autocommit, ConnectionRunnable block)
autocommit
- Auto-commit settingblock
- Code block to executepublic static void withConnection(ConnectionRunnable block)
block
- Code block to executepublic static <A> A withConnection(java.lang.String name, boolean autocommit, ConnectionCallable<A> block, play.api.Application application)
A
- the provided code block's return typename
- Datasource nameautocommit
- Auto-commit settingblock
- Code block to executeapplication
- Play application (play.api.Play.unsafeApplication())public static <A> A withConnection(java.lang.String name, ConnectionCallable<A> block, play.api.Application application)
A
- the provided code block's return typename
- Datasource nameblock
- Code block to executeapplication
- Play application (play.api.Play.unsafeApplication())public static <A> A withConnection(boolean autocommit, ConnectionCallable<A> block, play.api.Application application)
A
- the provided code block's return typeautocommit
- Auto-commit settingblock
- Code block to executeapplication
- Play application (play.api.Play.unsafeApplication())public static <A> A withConnection(ConnectionCallable<A> block, play.api.Application application)
A
- the provided code block's return typeblock
- Code block to executeapplication
- Play application (play.api.Play.unsafeApplication())public static <A> A withConnection(java.lang.String name, boolean autocommit, ConnectionCallable<A> block)
A
- the provided code block's return typename
- Datasource nameautocommit
- Auto-commit settingblock
- Code block to executepublic static <A> A withConnection(java.lang.String name, ConnectionCallable<A> block)
A
- the provided code block's return typename
- Datasource nameblock
- Code block to executepublic static <A> A withConnection(boolean autocommit, ConnectionCallable<A> block)
A
- the provided code block's return typeautocommit
- Auto-commit settingblock
- Code block to executepublic static <A> A withConnection(ConnectionCallable<A> block)
A
- the provided code block's return typeblock
- Code block to executepublic static void withTransaction(java.lang.String name, ConnectionRunnable block, play.api.Application application)
name
- Datasource nameblock
- Code block to executeapplication
- Play application (play.api.Play.unsafeApplication())public static void withTransaction(ConnectionRunnable block, play.api.Application application)
block
- Code block to executeapplication
- Play application (play.api.Play.unsafeApplication())public static void withTransaction(java.lang.String name, ConnectionRunnable block)
name
- Datasource nameblock
- Code block to executepublic static void withTransaction(ConnectionRunnable block)
block
- Code block to executepublic static <A> A withTransaction(java.lang.String name, ConnectionCallable<A> block, play.api.Application application)
A
- the provided code block's return typename
- Datasource nameblock
- Code block to executeapplication
- Play application (play.api.Play.unsafeApplication())public static <A> A withTransaction(ConnectionCallable<A> block, play.api.Application application)
A
- the provided code block's return typeblock
- Code block to executeapplication
- Play application (play.api.Play.unsafeApplication())public static <A> A withTransaction(java.lang.String name, ConnectionCallable<A> block)
A
- the provided code block's return typename
- Datasource nameblock
- Code block to executepublic static <A> A withTransaction(ConnectionCallable<A> block)
A
- the provided code block's return typeblock
- Code block to executepublic static final scala.runtime.AbstractFunction1<java.sql.Connection,scala.runtime.BoxedUnit> connectionFunction(ConnectionRunnable block)
block
- a Java functional interface instance to wrappublic static final <A> scala.runtime.AbstractFunction1<java.sql.Connection,A> connectionFunction(ConnectionCallable<A> block)
A
- the provided block's return typeblock
- a Java functional interface instance to wrap