Connection
interfacein packageklyn.databases.sql
public interface Connection extends AutoClosable:
└ Connection
SQL connection contract inspired by `java.sql.Connection`. The Klyn adaptation exposes connection state as properties instead of a getter/setter-heavy surface.
import klyn.databases.sql

connection as Connection = DriverManager.connect("jdbc:postgresql://db/app")
connection.autoCommit = false
Fields
Modifier and Type Member Description
public callable(sql
callable(sql as String,
Prepares one stored-procedure call.
public createStatement(resultSetType
createStatement(resultSetType as ResultSetType = ResultSetType.FORWARD_ONLY,
Java-compatible alias of `statement(.
public prepareCall(sql
prepareCall(sql as String,
Java-compatible alias of `callable(.
public prepareStatement(sql
prepareStatement(sql as String,
Java-compatible alias of `prepared(.
public prepared(sql
prepared(sql as String,
Prepares one SQL statement.
public statement(resultSetType
statement(resultSetType as ResultSetType = ResultSetType.FORWARD_ONLY,
Creates a statement with optional cursor settings.
Properties
Modifier and Type Member Description
public property autoCommit
autoCommit as Boolean
True when each statement is committed immediately.
public property catalog
catalog as String
Current catalog when supported by the driver.
public readonly property clientInfo
clientInfo as Map<String, String>
Mutable client-info map.
public readonly property closed
closed as Boolean
True when the connection has been closed.
public readonly property connected
connected as Boolean
True when the connection has been opened.
public property holdability
holdability as ResultSetHoldability
Current result-set holdability.
public readonly property metadata
metadata as DatabaseMetaData
Database metadata facade.
public property networkTimeoutMillis
networkTimeoutMillis as Int
Network timeout in milliseconds.
public property readOnly
readOnly as Boolean
True when the connection is read-only.
public property schema
schema as String
Current schema when supported by the driver.
public readonly property sslContext
sslContext as SSLContext
Optional TLS context used by the underlying secure transport.
public property transactionIsolation
transactionIsolation as TransactionIsolation
Current transaction isolation level.
public readonly property url
url as String
Effective connection URL.
public readonly property userName
userName as String
Effective user name.
public readonly property warning
warning as SQLWarning
Current warning chain.
Methods
Modifier and Type Member Description
public clearWarnings
clearWarnings() as Void
Clears the warning chain.
public commit
commit() as Void throws SQLException
Commits the current transaction.
public isValid
isValid(timeoutSeconds as Int = 0) as Boolean
Returns true when the connection is still usable.
public nativeSql
nativeSql(sql as String) as String
Converts generic SQL to the driver-native dialect.
public releaseSavepoint
releaseSavepoint(savepoint as Savepoint) as Void throws SQLException
Releases one savepoint.
public rollback
rollback(savepoint as Savepoint = null) as Void throws SQLException
Rolls back the current transaction or one savepoint.
public savepoint
savepoint(name as String = "") as Savepoint throws SQLException
Creates a savepoint descriptor.
Methods inherited from AutoClosable: close