scalikejdbc

NamedDB

case class NamedDB(name: Any)(implicit context: ConnectionPoolContext = NoConnectionPoolContext) extends DBConnection with Product with Serializable

Named Basic DB Accessor

It's easier to use named ConnectionPool with this class.

ConnectionPool.add('named, "jdbc:...", "user", "password")
val users = NamedDB('named) readOnly { session =>
  session.list("select * from user")
}
Linear Supertypes
Serializable, Serializable, Product, Equals, DBConnection, LoanPattern, LogSupport, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. NamedDB
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. DBConnection
  7. LoanPattern
  8. LogSupport
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new NamedDB(name: Any)(implicit context: ConnectionPoolContext = NoConnectionPoolContext)

Type Members

  1. type Closable = AnyRef { def close(): Unit }

    Definition Classes
    LoanPattern
  2. type RSTraversable = ResultSetTraversable

    Definition Classes
    DBConnection

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def autoCommit[A](execution: (DBSession) ⇒ A): A

    Provides auto-commit session block.

    Provides auto-commit session block.

    A

    return type

    execution

    block

    returns

    result value

    Definition Classes
    DBConnection
  6. def autoCommitSession(): DBSession

    Returns auto-commit session.

    Returns auto-commit session.

    returns

    session

    Definition Classes
    DBConnection
  7. def autoCommitWithConnection[A](execution: (Connection) ⇒ A): A

    Provides auto-commit session block.

    Provides auto-commit session block.

    A

    return type

    execution

    block

    returns

    result value

    Definition Classes
    DBConnection
  8. def begin(): Unit

    Begins a new transaction.

    Begins a new transaction.

    Definition Classes
    DBConnection
  9. def beginIfNotYet(): Unit

    Begins a new transaction if the other one does not already start.

    Begins a new transaction if the other one does not already start.

    Definition Classes
    DBConnection
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def close(): Unit

    Close the connection.

    Close the connection.

    Definition Classes
    DBConnection
  12. def commit(): Unit

    Commits the current transaction.

    Commits the current transaction.

    Definition Classes
    DBConnection
  13. def conn: Connection

    Definition Classes
    NamedDBDBConnection
  14. def currentTx: Tx

    Returns the current transaction.

    Returns the current transaction. If the transaction has not started yet, IllegalStateException will be thrown.

    returns

    tx

    Definition Classes
    DBConnection
  15. def describe(table: String): String

    Returns describe style string value for the table

    Returns describe style string value for the table

    table

    table name (with schema optionally)

    returns

    described information

    Definition Classes
    DBConnection
  16. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  17. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  19. def getColumnNames(tableName: String, tableTypes: Array[String] = Array("TABLE", "VIEW")): List[String]

    Returns all the column names on the matched table name

    Returns all the column names on the matched table name

    Definition Classes
    DBConnection
  20. def getTable(table: String, tableTypes: Array[String] = Array("TABLE", "VIEW")): Option[Table]

    Returns table information if exists

    Returns table information if exists

    table

    table name (with schema optionally)

    returns

    table information

    Definition Classes
    DBConnection
  21. def getTableNames(tableNamePattern: String = "%", tableTypes: Array[String] = Array("TABLE", "VIEW")): List[String]

    Returns all the table information that match the pattern

    Returns all the table information that match the pattern

    tableNamePattern

    table name pattern (with schema optionally)

    returns

    table information

    Definition Classes
    DBConnection
  22. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  23. def isTxAlreadyStarted: Boolean

    Returns is the current transaction already started.

    Returns is the current transaction already started.

    returns

    result

    Definition Classes
    DBConnection
  24. def isTxNotActive: Boolean

    Returns is the current transaction is active.

    Returns is the current transaction is active.

    returns

    result

    Definition Classes
    DBConnection
  25. def isTxNotYetStarted: Boolean

    Returns is the current transaction hasn't started yet.

    Returns is the current transaction hasn't started yet.

    returns

    result

    Definition Classes
    DBConnection
  26. def localTx[A](execution: (DBSession) ⇒ A): A

    Provides local-tx session block.

    Provides local-tx session block.

    A

    return type

    execution

    block

    returns

    result value

    Definition Classes
    DBConnection
  27. def localTxWithConnection[A](execution: (Connection) ⇒ A): A

    Provides local-tx session block.

    Provides local-tx session block.

    A

    return type

    execution

    block

    returns

    result value

    Definition Classes
    DBConnection
  28. val log: Log

    Logger

    Logger

    Attributes
    protected
    Definition Classes
    LogSupport
  29. val name: Any

  30. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  31. def newTx: Tx

    Starts a new transaction and returns it.

    Starts a new transaction and returns it.

    returns

    tx

    Definition Classes
    DBConnection
  32. final def notify(): Unit

    Definition Classes
    AnyRef
  33. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  34. def readOnly[A](execution: (DBSession) ⇒ A): A

    Provides read-only session block.

    Provides read-only session block.

    A

    return type

    execution

    block

    returns

    result value

    Definition Classes
    DBConnection
  35. def readOnlySession(): DBSession

    Returns read-only session.

    Returns read-only session.

    returns

    session

    Definition Classes
    DBConnection
  36. def readOnlyWithConnection[A](execution: (Connection) ⇒ A): A

    Provides read-only session block.

    Provides read-only session block.

    A

    return type

    execution

    block

    returns

    result value

    Definition Classes
    DBConnection
  37. def rollback(): Unit

    Rolls back the current transaction.

    Rolls back the current transaction.

    Definition Classes
    DBConnection
  38. def rollbackIfActive(): Unit

    Rolls back the current transaction if the transaction is still active.

    Rolls back the current transaction if the transaction is still active.

    Definition Classes
    DBConnection
  39. def showTables(tableNamePattern: String = "%", tableTypes: Array[String] = Array("TABLE", "VIEW")): String

    Returns table name list

    Returns table name list

    tableNamePattern

    table name pattern

    tableTypes

    table types

    returns

    table name list

    Definition Classes
    DBConnection
  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  41. def toDB(): DB

  42. def tx: Tx

    Returns the current transaction.

    Returns the current transaction. If the transaction has not started yet, IllegalStateException will be thrown.

    returns

    tx

    Definition Classes
    DBConnection
  43. def using[R <: Closable, A](resource: R)(f: (R) ⇒ A): A

    Definition Classes
    LoanPattern
  44. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. def withinTx[A](execution: (DBSession) ⇒ A): A

    Provides within-tx session block.

    Provides within-tx session block.

    A

    return type

    execution

    block

    returns

    result value

    Definition Classes
    DBConnection
  48. def withinTxSession(tx: Tx = currentTx): DBSession

    Returns within-tx session.

    Returns within-tx session.

    returns

    session

    Definition Classes
    DBConnection
  49. def withinTxWithConnection[A](execution: (Connection) ⇒ A): A

    Provides within-tx session block.

    Provides within-tx session block.

    A

    return type

    execution

    block

    returns

    result value

    Definition Classes
    DBConnection

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from DBConnection

Inherited from LoanPattern

Inherited from LogSupport

Inherited from AnyRef

Inherited from Any

Ungrouped