Main Page | Class List | Class Members | Related Pages

OdbcConnection Class Reference

Helper class for the connection handle hdbc. More...

List of all members.

Public Member Functions

public OdbcEnvironment environment ()
 The parent environment for this connection.
public HDBC handle ()
 The underlying hdbc for operations not provided by this class.
public bit autoCommit ()
 True if autocommit is on. False otherwise.
public void autoCommit (bit onoff)
 Sets autocommit on or off.
public void connectDriver (char[] connectionString)
 Connects to a database service providing a connection string.
public void connect (char[] dsn, char[] username="", char[] password="")
 Connects to a database service providing DSN, and optionally username and password.
public char[] connectionString ()
 Returns the connection string as returned from connect.
public SqlResult newResult ()
 Returns a new result to be executed on this connection.
public SqlResult execDirect (char[] sql)
 Executes a query and returns the result.
public void commit ()
 Commits changes if autocommit is off.
public void rollback ()
 Rolls back changes if autocommit is off.
public void disconnect ()
 Disconnects from the database, making this object available for another connection.
public void free ()
 Deletes this object.

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.


Detailed Description

Helper class for the connection handle hdbc.

Pass your SQL query string to execDirect. The result will be returned in an SqlResult object.


Member Function Documentation

public void OdbcConnection.connectDriver char[]  connectionString  ) 
 

Connects to a database service providing a connection string.

public void OdbcConnection.connect char[]  dsn,
char[]  username = "",
char[]  password = ""
 

Connects to a database service providing DSN, and optionally username and password.

public void OdbcConnection.disconnect  ) 
 

Disconnects from the database, making this object available for another connection.

Warning:
Do not use any result object derived from this connection after a call to disconnect since the handle will be invalid.

public void OdbcConnection.free  ) 
 

Deletes this object.

Warning:
connection.free(); and delete connection; both delete ALL result objects derived from this connection!


Member Data Documentation

public RETCODE OdbcConnection.lastRetcode
 

Return code from the last API call.

If this is set to SQL_SUCCESS_WITH_INFO, the info message is available in lastMessage.


Generated on Tue Sep 21 00:33:13 2004 for Simple Database Objects by doxygen 1.3.8