trait DB extends Loggable
- Alphabetic
- By Inheritance
- DB
- Loggable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- case class ConnectionHolder (conn: SuperConnection, cnt: Int, postTransaction: List[(Boolean) ⇒ Unit], rolledBack: Boolean) extends Product with Serializable
- type LogFunc = (DBLog, Long) ⇒ Any
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addLogFunc(f: LogFunc): List[LogFunc]
-
def
appendPostTransaction(func: (Boolean) ⇒ Unit): Unit
Append function to be invoked after the current transaction on DefaultConnectionIdentifier has ended
-
def
appendPostTransaction(name: ConnectionIdentifier, func: (Boolean) ⇒ Unit): Unit
Append a function to be invoked after the transaction on the specified connection identifier has ended.
Append a function to be invoked after the transaction on the specified connection identifier has ended. The value passed to the function indicates true for success/commit or false for failure/rollback.
Note: the function will only be called when automatic transaction management is in effect, either by executing within the context of a buildLoanWrapper or a DB.use {}
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
buildLoanWrapper(eager: Boolean, in: List[ConnectionIdentifier]): LoanWrapper
Build a LoanWrapper to pass into S.addAround() to make requests for the List of ConnectionIdentifiers transactional for the complete HTTP request
-
def
buildLoanWrapper(eager: Boolean): LoanWrapper
Build a LoanWrapper to pass into S.addAround() to make requests for the DefaultConnectionIdentifier transactional for the complete HTTP request
-
def
buildLoanWrapper(in: List[ConnectionIdentifier]): LoanWrapper
Build a LoanWrapper to pass into S.addAround() to make requests for the List of ConnectionIdentifiers transactional for the complete HTTP request
-
def
buildLoanWrapper(): LoanWrapper
Build a LoanWrapper to pass into S.addAround() to make requests for the DefaultConnectionIdentifier transactional for the complete HTTP request
- def checkNull[T](rs: ResultSet, pos: Int, res: ⇒ T): T
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def currentConnection: Box[SuperConnection]
-
lazy val
defaultReservedWords: Set[String]
The default reserved words.
The default reserved words.
TODO : Maybe this should be refactored to allow for driver-specific reserved words
- def defineConnectionManager(name: ConnectionIdentifier, mgr: ConnectionManager): Unit
-
def
doWithConnectionManagers[T](mgrs: (ConnectionIdentifier, ConnectionManager)*)(f: ⇒ T): T
Allows you to override the connection manager associated with particular connection identifiers for the duration of the call.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
exec[T](statement: PreparedStatement)(f: (ResultSet) ⇒ T): T
Executes { @code statement } and converts the { @code ResultSet } to model instance { @code T } using { @code f }
- def exec[T](db: SuperConnection, query: String)(f: (ResultSet) ⇒ T): T
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- val globalDefaultSchemaName: Box[String]
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
jndiJdbcConnAvailable_?: Boolean
can we get a JDBC connection from JNDI?
-
val
logger: Logger
- Attributes
- protected
- Definition Classes
- Loggable
- Annotations
- @transient()
- def loggingEnabled_?: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- def performQuery(query: String): (List[String], List[List[Any]])
-
def
performQuery(query: String, params: List[Any], connectionIdentifier: ConnectionIdentifier): (List[String], List[List[Any]])
Executes the given parameterized query string with the given parameters.
Executes the given parameterized query string with the given parameters. Parameters are substituted in order. For Date/Time types, passing a java.util.Date will result in a Timestamp parameter. If you want a specific SQL Date/Time type, use the corresponding java.sql.Date, java.sql.Time, or java.sql.Timestamp classes.
-
def
performQuery(query: String, params: List[Any]): (List[String], List[List[Any]])
Executes the given parameterized query string with the given parameters.
Executes the given parameterized query string with the given parameters. Parameters are substituted in order. For Date/Time types, passing a java.util.Date will result in a Timestamp parameter. If you want a specific SQL Date/Time type, use the corresponding java.sql.Date, java.sql.Time, or java.sql.Timestamp classes.
-
def
prepareStatement[T](statement: String, autoColumns: Array[String], conn: SuperConnection)(f: (PreparedStatement) ⇒ T): T
Prepares the given statement and then passes it to the given function for use.
Prepares the given statement and then passes it to the given function for use. This method represents a loan pattern, and will automatically handle creation and closing of the PreparedStatement.
If the driver supports it, generated keys for the given column names can be retrieved.
-
def
prepareStatement[T](statement: String, autoColumns: Array[Int], conn: SuperConnection)(f: (PreparedStatement) ⇒ T): T
Prepares the given statement and then passes it to the given function for use.
Prepares the given statement and then passes it to the given function for use. This method represents a loan pattern, and will automatically handle creation and closing of the PreparedStatement.
If the driver supports it, generated keys for the given column indices can be retrieved.
-
def
prepareStatement[T](statement: String, autokeys: Int, conn: SuperConnection)(f: (PreparedStatement) ⇒ T): T
Prepares the given statement and then passes it to the given function for use.
Prepares the given statement and then passes it to the given function for use. This method represents a loan pattern, and will automatically handle creation and closing of the PreparedStatement.
Retrieval of generated keys is controlled with the autokeys parameter, corresponding to the constants defined on java.sql.Statement: RETURN_GENERATED_KEYS or NO_GENERATED_KEYS
-
def
prepareStatement[T](statement: String, conn: SuperConnection)(f: (PreparedStatement) ⇒ T): T
Prepares the given statement and then passes it to the given function for use.
Prepares the given statement and then passes it to the given function for use. This method represents a loan pattern, and will automatically handle creation and closing of the PreparedStatement.
-
val
queryCollector: LogFunc
queryCollector can be used to collect all statements executed in a single request when passed to addLogFunc
queryCollector can be used to collect all statements executed in a single request when passed to addLogFunc
Use S.queryLog to get the list of (statement, duration) entries or set an analyzer function using S.addAnalyzer
- Annotations
- @volatile()
- val queryTimeout: Box[Int]
-
def
reservedWords: Set[String]
The SQL reserved words.
The SQL reserved words. These words will be changed if they are used for column or table names.
- def resultSetTo(rs: ResultSet): (List[String], List[List[String]])
- def resultSetToAny(rs: ResultSet): (List[String], List[List[Any]])
- def rollback: Unit
- def rollback(name: ConnectionIdentifier): Unit
- def runQuery(query: String): (List[String], List[List[String]])
-
def
runQuery(query: String, params: List[Any], connectionIdentifier: ConnectionIdentifier): (List[String], List[List[String]])
Executes the given parameterized query string with the given parameters.
Executes the given parameterized query string with the given parameters. Parameters are substituted in order. For Date/Time types, passing a java.util.Date will result in a Timestamp parameter. If you want a specific SQL Date/Time type, use the corresponding java.sql.Date, java.sql.Time, or java.sql.Timestamp classes.
-
def
runQuery(query: String, params: List[Any]): (List[String], List[List[String]])
Executes the given parameterized query string with the given parameters.
Executes the given parameterized query string with the given parameters. Parameters are substituted in order. For Date/Time types, passing a java.util.Date will result in a Timestamp parameter. If you want a specific SQL Date/Time type, use the corresponding java.sql.Date, java.sql.Time, or java.sql.Timestamp classes.
-
def
runUpdate(query: String, params: List[Any], connectionIdentifier: ConnectionIdentifier): Int
Executes the given parameterized update string with the given parameters.
Executes the given parameterized update string with the given parameters. Parameters are substituted in order. For Date/Time types, passing a java.util.Date will result in a Timestamp parameter. If you want a specific SQL Date/Time type, use the corresponding java.sql.Date, java.sql.Time, or java.sql.Timestamp classes.
-
def
runUpdate(query: String, params: List[Any]): Int
Executes the given parameterized update string with the given parameters.
Executes the given parameterized update string with the given parameters. Parameters are substituted in order. For Date/Time types, passing a java.util.Date will result in a Timestamp parameter. If you want a specific SQL Date/Time type, use the corresponding java.sql.Date, java.sql.Time, or java.sql.Timestamp classes.
- def statement[T](db: SuperConnection)(f: (Statement) ⇒ T): T
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
use[T](name: ConnectionIdentifier)(f: (SuperConnection) ⇒ T): T
Executes function { @code f } with the connection named { @code name }.
Executes function { @code f } with the connection named { @code name }. Releases the connection before returning.
Only use within a stateful request
-
val
userReservedWords: Box[Set[String]]
If you need to change some of the reserved word, you can supply your own set in Boot.scala: DB.userReservedWords = Full(Set("foo", "bar"))
If you need to change some of the reserved word, you can supply your own set in Boot.scala: DB.userReservedWords = Full(Set("foo", "bar"))
- Annotations
- @volatile()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )