trait Database extends AnyRef
- Alphabetic
- By Inheritance
- Database
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
dataSource: DataSource
The underlying JDBC data source for this database.
-
abstract
def
getConnection(autocommit: Boolean): Connection
Get a JDBC connection from the underlying data source.
Get a JDBC connection from the underlying data source.
Don't forget to release the connection at some point by calling close().
- autocommit
determines whether to autocommit the connection
- returns
a JDBC connection
-
abstract
def
getConnection(): Connection
Get a JDBC connection from the underlying data source.
Get a JDBC connection from the underlying data source. Autocommit is enabled by default.
Don't forget to release the connection at some point by calling close().
- returns
a JDBC connection
-
abstract
def
name: String
The configuration name for this database.
-
abstract
def
shutdown(): Unit
Shutdown this database, closing the underlying data source.
-
abstract
def
url: String
The JDBC connection URL this database, i.e.
The JDBC connection URL this database, i.e.
jdbc:...
Normally retrieved via a connection. -
abstract
def
withConnection[A](autocommit: Boolean)(block: (Connection) ⇒ A): A
Execute a block of code, providing a JDBC connection.
Execute a block of code, providing a JDBC connection. The connection and all created statements are automatically released.
- autocommit
determines whether to autocommit the connection
- block
code to execute
- returns
the result of the code block
-
abstract
def
withConnection[A](block: (Connection) ⇒ A): A
Execute a block of code, providing a JDBC connection.
Execute a block of code, providing a JDBC connection. The connection and all created statements are automatically released.
- block
code to execute
- returns
the result of the code block
-
abstract
def
withTransaction[A](block: (Connection) ⇒ A): A
Execute a block of code in the scope of a JDBC transaction.
Execute a block of code in the scope of a JDBC transaction. The connection and all created statements are automatically released. The transaction is automatically committed, unless an exception occurs.
- block
code to execute
- returns
the result of the code block