Public Member Functions | |
public | this () |
Sets up an environment for odbc version 3 (SQL_OV_ODBC3). | |
public | this (uint odbcVersion) |
Sets up an environment for the odbc version passed in. | |
public HENV | handle () |
The underlying henv for operations not provided by this class. | |
public char[][2][] | drivers () |
A list of available drivers in this environment. | |
public OdbcConnection | newConnection () |
Returns a new, unconnected connection object bound to this environment. | |
public OdbcConnection | connect (char[] dsn, char[] username="", char[] password="") |
Connect to a database providing DSN, and optionally username and password. | |
public OdbcConnection | connectDriver (char[] connectionString) |
Connect to a database providing a connection string. | |
public void | commit () |
Commits changes for all connections. | |
public void | rollback () |
Rolls back changes for all connections. | |
public void | free () |
Deletes this object. | |
Static Public Member Functions | |
public void | setLibPath (char[] odbc32dll) |
Sets the path to odbc32.dll (windows). | |
public bit | probeOdbc32dll () |
Probes the odbc library. | |
public void | freeOdbc32dll () |
Frees the odbc library. Throws an exception. | |
Public Attributes | |
public RETCODE | lastRetcode |
Return code from the last API call. | |
public OdbcMessage | lastMessage |
Diagnostics message from the last odbc call that returned SQL_SUCCESS_WITH_INFO. |
After instanciating a new environment, applications can call connect and connectDriver to get an OdbcConnection.
|
Sets the path to odbc32.dll (windows). By default, the dll filename is set to odbc32.dll. Does nothing on linux |
|
Probes the odbc library. Returns true if the library is already loaded. If not loaded, attempts to load the library and returns true on sucess, false otherwise. If odbc32.dll is not found you can provide a path with setLibPath. Always returns true on linux |
|
Frees the odbc library. Throws an exception.
Does nothing on linux |
|
Sets up an environment for odbc version 3 (SQL_OV_ODBC3). Most applications will need only one environment to create all connections. |
|
A list of available drivers in this environment. The first string in each row of the array (drivers[i][0]) holds the Driver Description. The second string in each row of the array (drivers[i][1]) holds the Driver Attributes. |
|
Connect to a database providing DSN, and optionally username and password. Connects directly using default attributes and returns a connected connection object. |
|
Connect to a database providing a connection string. Connects directly using default attributes and returns a connected connection object. If you need to set attributes prior to connect, use newConnection(). |
|
Deletes this object.
|
|
Return code from the last API call. If this is set to SQL_SUCCESS_WITH_INFO, the info message is available in lastMessage. |