Connection

ldbc.connector.Connection
See theConnection companion object
trait Connection[F[_]]

A connection (session) with a specific database. SQL statements are executed and results are returned within the context of a connection.

Type parameters

F

the effect type

Attributes

Companion
object
Source
Connection.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class ConnectionImpl[F]

Members list

Value members

Abstract methods

def changeUser(user: String, password: String): F[Unit]

Changes the user and password for this connection.

Changes the user and password for this connection.

Value parameters

password

the new password

user

the new user name

Attributes

Source
Connection.scala

Creates a client-side prepared statement with the given SQL.

Creates a client-side prepared statement with the given SQL.

Value parameters

sql

SQL queries based on text protocols

Attributes

Source
Connection.scala
def clientPreparedStatement(sql: String, resultSetType: Int, resultSetConcurrency: Int): F[Client[F]]

Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.

Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.

Value parameters

resultSetConcurrency

resultSetConcurrency

resultSetType

resultSetType

sql

statement

Attributes

Returns

prepared statement

Source
Connection.scala
def close(): F[Unit]

Releases this Connection object's database and LDBC resources immediately instead of waiting for them to be automatically released.

Releases this Connection object's database and LDBC resources immediately instead of waiting for them to be automatically released.

Calling the method close on a Connection object that is already closed is a no-op.

It is strongly recommended that an application explicitly commits or rolls back an active transaction prior to calling the close method. If the close method is called and there is an active transaction, the results are implementation-defined.

Attributes

Source
Connection.scala
def commit(): F[Unit]

Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object. This method should be used only when auto-commit mode has been disabled.

Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object. This method should be used only when auto-commit mode has been disabled.

Attributes

Source
Connection.scala
def createStatement(): F[Statement[F]]

Creates a Statement object for sending SQL statements to the database. SQL statements without parameters are normally executed using Statement objects. If the same SQL statement is executed many times, it may be more efficient to use a PreparedStatement object.

Creates a Statement object for sending SQL statements to the database. SQL statements without parameters are normally executed using Statement objects. If the same SQL statement is executed many times, it may be more efficient to use a PreparedStatement object.

Attributes

Source
Connection.scala
def createStatement(resultSetType: Int, resultSetConcurrency: Int): F[Statement[F]]

Creates a Statement object that will generate ResultSet objects with the given type and concurrency. This method is the same as the createStatement method above, but it allows the default result set type and concurrency to be overridden. The holdability of the created result sets can be determined by calling [[#getHoldability]].

Creates a Statement object that will generate ResultSet objects with the given type and concurrency. This method is the same as the createStatement method above, but it allows the default result set type and concurrency to be overridden. The holdability of the created result sets can be determined by calling [[#getHoldability]].

Value parameters

resultSetConcurrency

a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE

resultSetType

a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE

Attributes

Returns

a new Statement object that will generate ResultSet objects with the given type and concurrency

Source
Connection.scala

Retrieves the current auto-commit mode for this Connection object.

Retrieves the current auto-commit mode for this Connection object.

Attributes

Returns

the current state of this Connection object's auto-commit mode

Source
Connection.scala
def getSchema: F[String]

Retrieves this Connection object's current schema name.

Retrieves this Connection object's current schema name.

Attributes

Returns

the current schema name or null if there is none

Source
Connection.scala

Retrieves the statistics of this Connection object.

Retrieves the statistics of this Connection object.

Attributes

Returns

the statistics of this Connection object

Source
Connection.scala

Retrieves this Connection object's current transaction isolation level.

Retrieves this Connection object's current transaction isolation level.

Attributes

Returns

the current transaction isolation level, which will be one of the following constants: Connection.TransactionIsolationLevel.READ_UNCOMMITTED, Connection.TransactionIsolationLevel.READ_COMMITTED, Connection.TransactionIsolationLevel.REPEATABLE_READ, or Connection.TransactionIsolationLevel.SERIALIZABLE

Source
Connection.scala

Retrieves whether this Connection object is in read-only mode.

Retrieves whether this Connection object is in read-only mode.

Attributes

Returns

true if this Connection object is read-only; false otherwise

Source
Connection.scala
def isValid: F[Boolean]

Returns true if the connection has not been closed and is still valid.

Returns true if the connection has not been closed and is still valid.

Attributes

Source
Connection.scala
def releaseSavepoint(savepoint: Savepoint): F[Unit]

Removes the specified Savepoint and subsequent Savepoint objects from the current transaction. Any reference to the savepoint after it have been removed will cause an SQLException to be thrown.

Removes the specified Savepoint and subsequent Savepoint objects from the current transaction. Any reference to the savepoint after it have been removed will cause an SQLException to be thrown.

Value parameters

savepoint

the Savepoint object to release

Attributes

Source
Connection.scala

Resets the server-side state of this connection.

Resets the server-side state of this connection.

Attributes

Source
Connection.scala
def rollback(): F[Unit]

Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object. This method should be used only when auto-commit mode has been disabled.

Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object. This method should be used only when auto-commit mode has been disabled.

Attributes

Source
Connection.scala
def rollback(savepoint: Savepoint): F[Unit]

Undoes all changes made after the given Savepoint object was set. This method should be used only when auto-commit has been disabled.

Undoes all changes made after the given Savepoint object was set. This method should be used only when auto-commit has been disabled.

Value parameters

savepoint

the Savepoint object to roll back to

Attributes

Source
Connection.scala

Creates a server prepared statement with the given SQL.

Creates a server prepared statement with the given SQL.

Value parameters

sql

SQL queries based on text protocols

Attributes

Source
Connection.scala
def serverPreparedStatement(sql: String, resultSetType: Int, resultSetConcurrency: Int): F[Server[F]]

Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.

Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.

Value parameters

resultSetConcurrency

resultSetConcurrency

resultSetType

resultSetType

sql

statement

Attributes

Returns

prepared statement

Source
Connection.scala
def setAutoCommit(isAutoCommit: Boolean): F[Unit]

Sets this connection's auto-commit mode to the given state. If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either the method commit or the method rollback. By default, new connections are in auto-commit mode.

Sets this connection's auto-commit mode to the given state. If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either the method commit or the method rollback. By default, new connections are in auto-commit mode.

Value parameters

isAutoCommit

true to enable auto-commit mode; false to disable it

Attributes

Source
Connection.scala
def setOption(optionOperation: EnumMySQLSetOption): F[Unit]

Controls whether or not multiple SQL statements are allowed to be executed at once.

Controls whether or not multiple SQL statements are allowed to be executed at once.

NOTE: It can only be used for batch processing with Insert, Update, and Delete statements.

Value parameters

optionOperation

EnumMySQLSetOption.MYSQL_OPTION_MULTI_STATEMENTS_ON or EnumMySQLSetOption.MYSQL_OPTION_MULTI_STATEMENTS_OFF

Attributes

Source
Connection.scala
def setReadOnly(isReadOnly: Boolean): F[Unit]

Puts this connection in read-only mode as a hint to the driver to enable database optimizations.

Puts this connection in read-only mode as a hint to the driver to enable database optimizations.

Value parameters

isReadOnly

true enables read-only mode; false disables it

Attributes

Source
Connection.scala

Creates an unnamed savepoint in the current transaction and returns the new Savepoint object that represents it. if setSavepoint is invoked outside of an active transaction, a transaction will be started at this newly created savepoint.

Creates an unnamed savepoint in the current transaction and returns the new Savepoint object that represents it. if setSavepoint is invoked outside of an active transaction, a transaction will be started at this newly created savepoint.

Attributes

Returns

the new Savepoint object

Source
Connection.scala
def setSavepoint(name: String): F[Savepoint]

Creates a savepoint with the given name in the current transaction and returns the new Savepoint object that represents it. if setSavepoint is invoked outside of an active transaction, a transaction will be started at this newly created savepoint.

Creates a savepoint with the given name in the current transaction and returns the new Savepoint object that represents it. if setSavepoint is invoked outside of an active transaction, a transaction will be started at this newly created savepoint.

Value parameters

name

a String containing the name of the savepoint

Attributes

Returns

the new Savepoint object

Source
Connection.scala
def setSchema(schema: String): F[Unit]

Sets the schema name that will be used for subsequent queries.

Sets the schema name that will be used for subsequent queries.

Calling setSchema has no effect on previously created or prepared Statement objects. It is implementation defined whether a DBMS prepare operation takes place immediately when the Connection method statement or clientPreparedStatement, serverPreparedStatement is invoked. For maximum portability, setSchema should be called before a Statement is created or prepared.

Value parameters

schema

the name of a schema in which to work

Attributes

Source
Connection.scala

Attempts to change the transaction isolation level for this Connection object to the one given. The constants defined in the interface Connection are the possible transaction isolation levels.

Attempts to change the transaction isolation level for this Connection object to the one given. The constants defined in the interface Connection are the possible transaction isolation levels.

Value parameters

level

one of the following Connection constants: Connection.TransactionIsolationLevel.READ_UNCOMMITTED, Connection.TransactionIsolationLevel.READ_COMMITTED, Connection.TransactionIsolationLevel.REPEATABLE_READ, or Connection.TransactionIsolationLevel.SERIALIZABLE

Attributes

Source
Connection.scala

Concrete methods

Disables multiple SQL statements to be executed at once.

Disables multiple SQL statements to be executed at once.

NOTE: It can only be used for batch processing with Insert, Update, and Delete statements.

Attributes

Source
Connection.scala

Enables multiple SQL statements to be executed at once.

Enables multiple SQL statements to be executed at once.

NOTE: It can only be used for batch processing with Insert, Update, and Delete statements.

Attributes

Source
Connection.scala