Trait

scalikejdbc

DBConnection

Related Doc: package scalikejdbc

Permalink

trait DBConnection extends LogSupport with LoanPattern with AutoCloseable

Basic Database Accessor which holds a JDBC connection.

Source
DBConnection.scala
Linear Supertypes
AutoCloseable, LoanPattern, LogSupport, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DBConnection
  2. AutoCloseable
  3. LoanPattern
  4. LogSupport
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

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

    Permalink
    Definition Classes
    LoanPattern
  2. type RSTraversable = ResultSetTraversable

    Permalink

Abstract Value Members

  1. abstract def conn: Connection

    Permalink

    Returns current JDBC connection.

  2. abstract val settingsProvider: SettingsProvider

    Permalink
    Attributes
    protected[this]

Concrete Value Members

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

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

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

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

    Permalink
    Definition Classes
    Any
  5. def autoClose(autoClose: Boolean): DBConnection

    Permalink

    Switches auto close mode.

    Switches auto close mode.

    autoClose

    auto close enabled if true

  6. def autoCommit[A](execution: (DBSession) ⇒ A): A

    Permalink

    Provides auto-commit session block.

    Provides auto-commit session block.

    A

    return type

    execution

    block

    returns

    result value

  7. def autoCommitSession(settings: SettingsProvider = SettingsProvider.default): DBSession

    Permalink

    Returns auto-commit session.

    Returns auto-commit session.

    returns

    session

  8. def autoCommitWithConnection[A](execution: (Connection) ⇒ A): A

    Permalink

    Provides auto-commit session block.

    Provides auto-commit session block.

    A

    return type

    execution

    block

    returns

    result value

  9. def begin(): Unit

    Permalink

    Begins a new transaction.

  10. def beginIfNotYet(): Unit

    Permalink

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

  11. def clone(): AnyRef

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

    Permalink

    Close the connection.

    Close the connection.

    Definition Classes
    DBConnection → AutoCloseable
  13. def commit(): Unit

    Permalink

    Commits the current transaction.

  14. def connectionAttributes: DBConnectionAttributes

    Permalink

    returns the additional attributes of current JDBC connection.

  15. def currentTx: Tx

    Permalink

    Returns the current transaction.

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

    returns

    tx

  16. def describe(table: String): String

    Permalink

    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

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

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

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

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

    Permalink

    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

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

    Permalink

    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
  22. def getAllColumns(meta: DatabaseMetaData, schema: String, table: String): ResultSet

    Permalink

    Returns columns resultset in schema.tableNames

    Returns columns resultset in schema.tableNames

    meta

    database meta data

    schema

    schema name

    table

    table name

    returns

    resultset related to columns

  23. final def getClass(): Class[_]

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

    Permalink

    Returns all the column names on the matched table name

  25. def getTable(table: String, tableTypes: Array[String] = Array("TABLE", "VIEW")): Option[Table]

    Permalink

    Returns table information if exists

    Returns table information if exists

    table

    table name (with schema optionally)

    returns

    table information

  26. def getTableNames(tableNamePattern: String = "%", tableTypes: Array[String] = Array("TABLE", "VIEW")): List[String]

    Permalink

    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

  27. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  29. def isTxAlreadyStarted: Boolean

    Permalink

    Returns is the current transaction already started.

    Returns is the current transaction already started.

    returns

    result

  30. def isTxNotActive: Boolean

    Permalink

    Returns is the current transaction is active.

    Returns is the current transaction is active.

    returns

    result

  31. def isTxNotYetStarted: Boolean

    Permalink

    Returns is the current transaction hasn't started yet.

    Returns is the current transaction hasn't started yet.

    returns

    result

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

    Permalink

    Provides local-tx session block.

    Provides local-tx session block.

    A

    return type

    execution

    block

    returns

    result value

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

    Permalink

    Provides local-tx session block.

    Provides local-tx session block.

    A

    return type

    execution

    block

    returns

    result value

  34. val log: Log

    Permalink

    Logger

    Logger

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

    Permalink
    Definition Classes
    AnyRef
  36. def newTx: Tx

    Permalink

    Starts a new transaction and returns it.

    Starts a new transaction and returns it.

    returns

    tx

  37. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  38. final def notifyAll(): Unit

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

    Permalink

    Provides read-only session block.

    Provides read-only session block.

    A

    return type

    execution

    block

    returns

    result value

  40. def readOnlySession(settings: SettingsProvider = SettingsProvider.default): DBSession

    Permalink

    Returns read-only session.

    Returns read-only session.

    returns

    session

  41. def readOnlyWithConnection[A](execution: (Connection) ⇒ A): A

    Permalink

    Provides read-only session block.

    Provides read-only session block.

    A

    return type

    execution

    block

    returns

    result value

  42. def rollback(): Unit

    Permalink

    Rolls back the current transaction.

  43. def rollbackIfActive(): Unit

    Permalink

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

  44. def showTables(tableNamePattern: String = "%", tableTypes: Array[String] = Array("TABLE", "VIEW")): String

    Permalink

    Returns table name list

    Returns table name list

    tableNamePattern

    table name pattern

    tableTypes

    table types

    returns

    table name list

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

    Permalink
    Definition Classes
    AnyRef
  46. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  47. def tx: Tx

    Permalink

    Returns the current transaction.

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

    returns

    tx

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

    Permalink
    Definition Classes
    LoanPattern
  49. final def wait(): Unit

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

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

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

    Permalink

    Provides within-tx session block.

    Provides within-tx session block.

    A

    return type

    execution

    block

    returns

    result value

  53. def withinTxSession(tx: Tx = currentTx, settings: SettingsProvider = SettingsProvider.default): DBSession

    Permalink

    Returns within-tx session.

    Returns within-tx session.

    returns

    session

  54. def withinTxWithConnection[A](execution: (Connection) ⇒ A): A

    Permalink

    Provides within-tx session block.

    Provides within-tx session block.

    A

    return type

    execution

    block

    returns

    result value

Inherited from AutoCloseable

Inherited from LoanPattern

Inherited from LogSupport

Inherited from AnyRef

Inherited from Any

Ungrouped