scalikejdbc

DBConnection

trait DBConnection extends LogSupport with LoanPattern

Basic Database Accessor which holds a JDBC connection.

Source
DBConnection.scala
Linear Supertypes
LoanPattern, LogSupport, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DBConnection
  2. LoanPattern
  3. LogSupport
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

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

    Definition Classes
    LoanPattern
  2. type RSTraversable = ResultSetTraversable

Abstract Value Members

  1. abstract def conn: Connection

    Returns current JDBC connection.

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

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

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def autoClose(autoClose: Boolean): DBConnection

    Switches auto close mode.

    Switches auto close mode.

    autoClose

    auto close enabled if true

  8. 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

  9. def autoCommitSession(): DBSession

    Returns auto-commit session.

    Returns auto-commit session.

    returns

    session

  10. 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

  11. def begin(): Unit

    Begins a new transaction.

  12. def beginIfNotYet(): Unit

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

  13. def clone(): AnyRef

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

    Close the connection.

  15. def commit(): Unit

    Commits the current transaction.

  16. def connectionAttributes: DBConnectionAttributes

    returns the additional attributes of current JDBC connection.

  17. def currentTx: Tx

    Returns the current transaction.

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

    returns

    tx

  18. 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

  19. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  21. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. def futureLocalTx[A](execution: (DBSession) ⇒ Future[A])(implicit ec: ExecutionContext): Future[A]

    Easy way to checkout the current connection to be used in a transaction that needs to be committed/rolled back depending on Future results.

    Easy way to checkout the current connection to be used in a transaction that needs to be committed/rolled back depending on Future results.

    A

    future result type

    execution

    block that takes a session and returns a future

    returns

    future result

  23. def futureUsing[R <: Closable, A](resource: R)(f: (R) ⇒ Future[A])(implicit ec: ExecutionContext): Future[A]

    Guarantees a Closeable resource will be closed after being passed to a block that takes the resource as a parameter and returns a Future.

    Guarantees a Closeable resource will be closed after being passed to a block that takes the resource as a parameter and returns a Future.

    Definition Classes
    LoanPattern
  24. final def getClass(): Class[_]

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

    Returns all the column names on the matched table name

  26. 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

  27. 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

  28. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  29. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  30. def isTxAlreadyStarted: Boolean

    Returns is the current transaction already started.

    Returns is the current transaction already started.

    returns

    result

  31. def isTxNotActive: Boolean

    Returns is the current transaction is active.

    Returns is the current transaction is active.

    returns

    result

  32. def isTxNotYetStarted: Boolean

    Returns is the current transaction hasn't started yet.

    Returns is the current transaction hasn't started yet.

    returns

    result

  33. def localTx[A](execution: (DBSession) ⇒ A)(implicit boundary: TxBoundary[A] = defaultTxBoundary[A]): A

    Provides local-tx session block.

    Provides local-tx session block.

    A

    return type

    execution

    block

    returns

    result value

  34. def localTxWithConnection[A](execution: (Connection) ⇒ A)(implicit boundary: TxBoundary[A] = defaultTxBoundary[A]): A

    Provides local-tx session block.

    Provides local-tx session block.

    A

    return type

    execution

    block

    returns

    result value

  35. val log: Log

    Logger

    Logger

    Attributes
    protected
    Definition Classes
    LogSupport
  36. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  37. def newTx: Tx

    Starts a new transaction and returns it.

    Starts a new transaction and returns it.

    returns

    tx

  38. final def notify(): Unit

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

    Definition Classes
    AnyRef
  40. 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

  41. def readOnlySession(): DBSession

    Returns read-only session.

    Returns read-only session.

    returns

    session

  42. 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

  43. def rollback(): Unit

    Rolls back the current transaction.

  44. def rollbackIfActive(): Unit

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

  45. 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

  46. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  47. def toString(): String

    Definition Classes
    AnyRef → Any
  48. def tx: Tx

    Returns the current transaction.

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

    returns

    tx

  49. def using[R <: Closable, A](resource: R)(f: (R) ⇒ A): A

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. 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

  54. def withinTxSession(tx: Tx = currentTx): DBSession

    Returns within-tx session.

    Returns within-tx session.

    returns

    session

  55. 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

Inherited from LoanPattern

Inherited from LogSupport

Inherited from AnyRef

Inherited from Any

Ungrouped