type

SqlConn

src mixin SqlConn

SqlConn manages a connection to a relational database. See pod-doc.

fields

autoCommit

If auto-commit is true then each statement is executed and committed as an individual transaction.

methods

close

Close the database connection.

commit

Commit all the changes made inside the current transaction.

isClosed

Return if close has been called.

meta

Get the database meta-data

open

Open a connection to the database specified by the given JDBC uri and username/password credentials.

rollback

Undo any changes made inside the current transaction.

sql

Create a statement for this database.

stash

User data stash for adding cached data to this connection.

Slot Details

autoCommit

src abstract Bool autoCommit

If auto-commit is true then each statement is executed and committed as an individual transaction. Otherwise statements are grouped into transaction which must be closed via commit or rollback.

close

src abstract Bool close()

Close the database connection. Closing a connection already closed is a no-op. This method is guaranteed to never throw an exception. Return true if the connection was closed successfully or false if closed abnormally.

Do not close connections that were created by SqlConnPool. The pool handles that for you.

commit

src abstract Void commit()

Commit all the changes made inside the current transaction.

isClosed

src abstract Bool isClosed()

Return if close has been called.

meta

src abstract SqlMeta meta()

Get the database meta-data

open

src static SqlConn open(Str uri, Str? username, Str? password)

Open a connection to the database specified by the given JDBC uri and username/password credentials. Raise exception if connection cannot be established. See pod-doc.

rollback

src abstract Void rollback()

Undo any changes made inside the current transaction.

sql

src abstract Statement sql(Str sql)

Create a statement for this database.

stash

src abstract Str:Obj? stash()

User data stash for adding cached data to this connection.