ODBCDbc¶
ODBCDbc¶
The class that wraps our ODBC Database handle.
Usage¶
var env: ODBCEnv = ODBCEnv
var dbc: ODBCDbc = env.dbc()?
// Disable autocommit, set application name, and connect to database
try
dbc
.> set_autocommit(false)? // Disable Autocommit
.> connect("mydsn")? // Connect to DSN "mydsn"
else
Debug.out("We failed.")
end
An example that demonstrates .commit() and .rollback() will be
documented in ODBCStmt as that requires an appropriate context to
make sense.
Implements¶
- SqlState ref
Public fields¶
var dbc: ODBCHandleDbc tag¶
var strict: Bool val¶
Public Functions¶
stmt¶
Used to create an ODBCStmt object from this ODBCDbc connection.
Returns¶
- ODBCStmt ref ?
sqlstates¶
Returns an array of SQL States
Returns¶
get_autocommit¶
Returns whether autocommit is enabled or disabled.
Parameters¶
- sl: SourceLoc val = __loc
Returns¶
- Bool val ?
set_autocommit¶
Enables or disables autocommit. Many RDBMSs require that this be configured before you initiate the actual connection with connect()?
Parameters¶
Returns¶
- Bool val ?
commit¶
Instructs the database to commit your transaction and open a new one.
Parameters¶
- sl: SourceLoc val = __loc
Returns¶
- Bool val ?
rollback¶
Instructs the database to rollback your transaction and open a new one.
Parameters¶
- sl: SourceLoc val = __loc
Returns¶
- Bool val ?
get_info_varchar¶
SQLGetInfo returns general information about the driver and data source associated with a connection.
fun ref get_info_varchar(
infotype: U16 val,
buf: SQLType ref,
sl: SourceLoc val = __loc)
: Bool val ?
Parameters¶
Returns¶
- Bool val ?
connect¶
Initiates the database connection to the database as defined by the DSN.
Parameters¶
Returns¶
- Bool val ?
disconnect¶
Disconnects the database connection from the database.
Returns¶
- Bool val ?