public class DriverManager:
SQL connection factory.
This class centralizes connection options, maintains the SQL driver registry, and delegates connection creation to the first driver supporting a URL.
import klyn.databases.sql
cnx = DriverManager.getConnection("mariadb://localhost:3306/app", "app", "secret")| Modifier and Type | Member | Description |
|---|---|---|
| public static | loginTimeoutSecondsloginTimeoutSeconds as Int = 0 |
Login timeout applied by driver resolution. |
| Modifier and Type | Member | Description |
|---|---|---|
| public static readonly property | drivers | Registered SQL drivers, in resolution order. |
| Modifier and Type | Member | Description |
|---|---|---|
| public static defaultProperties as | Map | Global arbitrary connection properties. |
| public static | connect | Opens a connection from a URL and optional properties. |
| public static | driverFordriverFor(url as String) as Driver throws SQLFeatureNotSupportedException: |
Returns the first registered driver supporting the URL. |
| public static | getConnectiongetConnection(url as String,
user as String = "",
password as String = "") as Connection throws Exception: |
Opens a SQL connection from a database URL and credentials. |
| public static | registerregister(driver as Driver) as Void throws SQLFeatureNotSupportedException: |
Registers a custom SQL driver at the end of the resolution list. |