public interface Connection extends AutoClosable:
SQL connection contract.
Connection state is exposed through properties. Execution objects are created with statement(), prepared(...), and callable(...).
import klyn.databases.sql
connection as Connection = DriverManager.connect("postgresql://db/app")
connection.autoCommit = false| Modifier and Type | Member | Description |
|---|---|---|
| public property | autoCommitautoCommit as Boolean |
True when each statement is committed immediately. |
| public property | catalogcatalog as String |
Current catalog when supported by the driver. |
| public readonly property | clientInfo | Mutable client-info map. |
| public readonly property | closedclosed as Boolean |
True when the connection has been closed. |
| public readonly property | connectedconnected as Boolean |
True when the connection has been opened. |
| public property | holdabilityholdability as ResultSetHoldability |
Current result-set holdability. |
| public readonly property | metadatametadata as DatabaseMetaData |
Database metadata facade. |
| public property | networkTimeoutMillisnetworkTimeoutMillis as Int |
Network timeout in milliseconds. |
| public property | readOnlyreadOnly as Boolean |
True when the connection is read-only. |
| public property | schemaschema as String |
Current schema when supported by the driver. |
| public readonly property | sslContextsslContext as SSLContext |
Optional TLS context used by the underlying secure transport. |
| public property | transactionIsolationtransactionIsolation as TransactionIsolation |
Current transaction isolation level. |
| public readonly property | urlurl as String |
Effective connection URL. |
| public readonly property | userNameuserName as String |
Effective user name. |
| public readonly property | warningwarning as SQLWarning |
Current warning chain. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | callablecallable(sql as String,
resultSetType as ResultSetType = ResultSetType.FORWARD_ONLY,
concurrency as ResultSetConcurrency = ResultSetConcurrency.READ_ONLY,
holdability as ResultSetHoldability = ResultSetHoldability.CLOSE_CURSORS_AT_COMMIT) as CallableStatement throws SQLException |
Prepares one stored-procedure call. |
| public | clearWarningsclearWarnings() as Void |
Clears the warning chain. |
| public | commitcommit() as Void throws SQLException |
Commits the current transaction. |
| public | createStatementcreateStatement(resultSetType as ResultSetType = ResultSetType.FORWARD_ONLY,
concurrency as ResultSetConcurrency = ResultSetConcurrency.READ_ONLY,
holdability as ResultSetHoldability = ResultSetHoldability.CLOSE_CURSORS_AT_COMMIT) as Statement throws SQLException |
Compatibility alias of `statement(. |
| public | isValid | Returns true when the connection is still usable. |
| public | nativeSql | Converts generic SQL to the driver-native dialect. |
| public | prepareCallprepareCall(sql as String,
resultSetType as ResultSetType = ResultSetType.FORWARD_ONLY,
concurrency as ResultSetConcurrency = ResultSetConcurrency.READ_ONLY,
holdability as ResultSetHoldability = ResultSetHoldability.CLOSE_CURSORS_AT_COMMIT) as CallableStatement throws SQLException |
Compatibility alias of `callable(. |
| public | prepareStatementprepareStatement(sql as String,
resultSetType as ResultSetType = ResultSetType.FORWARD_ONLY,
concurrency as ResultSetConcurrency = ResultSetConcurrency.READ_ONLY,
holdability as ResultSetHoldability = ResultSetHoldability.CLOSE_CURSORS_AT_COMMIT) as PreparedStatement throws SQLException |
Compatibility alias of `prepared(. |
| public | preparedprepared(sql as String,
resultSetType as ResultSetType = ResultSetType.FORWARD_ONLY,
concurrency as ResultSetConcurrency = ResultSetConcurrency.READ_ONLY,
holdability as ResultSetHoldability = ResultSetHoldability.CLOSE_CURSORS_AT_COMMIT) as PreparedStatement throws SQLException |
Prepares one SQL statement. |
| public | releaseSavepointreleaseSavepoint(savepoint as Savepoint) as Void throws SQLException |
Releases one savepoint. |
| public | rollbackrollback(savepoint as Savepoint = null) as Void throws SQLException |
Rolls back the current transaction or one savepoint. |
| public | savepointsavepoint(name as String = "") as Savepoint throws SQLException |
Creates a savepoint descriptor. |
| public | statementstatement(resultSetType as ResultSetType = ResultSetType.FORWARD_ONLY,
concurrency as ResultSetConcurrency = ResultSetConcurrency.READ_ONLY,
holdability as ResultSetHoldability = ResultSetHoldability.CLOSE_CURSORS_AT_COMMIT) as Statement throws SQLException |
Creates a statement with optional cursor settings. |