XUtils

ddbc

DDBC is a DB Connector for D language (similar to JDBC). HibernateD (see below) uses ddbc for database abstraction.


Connections Strings

Connection strings should start with ddbc: followed by the driver type, eg: ddbc:mysql://localhost. However, the ddbc prefix is optional.

The overall format is typically [ddbc:]<DRIVER:>//[ HOSTNAME [ ,PORT ]] [ ? <PARAMS> }] except for SQLite

SQLite

SQLite can be configured for file based persistence or in-memory storage.

ddbc:sqlite:ddbc-test.sqlite

An in memory database can be configured by specifying :memory: instead of a filename:

ddbc:sqlite::memory:

MySQL

ddbc:mysql://127.0.0.1:3306

PostgreSQL

ddbc:postgresql://127.0.0.1:5432

or

ddbc:postgresql://hostname:5432/dbname

Microsoft SQL Server (via ODBC)

ddbc:sqlserver://localhost,1433?user=sa,password=bbk4k77JKH88g54,driver=FreeTDS

or

ddbc:odbc://localhost,1433?user=sa,password=bbk4k77JKH88g54,driver=FreeTDS

Oracle (via ODBC) experimental

ddbc:oracle://localhost:1521?user=sa,password=bbk4k77JKH88g54,driver=FreeTDS

or

ddbc:odbc://localhost:1521?user=sa,password=bbk4k77JKH88g54,driver=FreeTDS

DSN connections for Microsoft SQL Server

The correct format to use for a dsn connection string is odbc://?dsn=<DSN name>. Note that the server portion before the ? is empty, so the default server for the DSN name will be used.


Articles

  • coming soon...