Database Toolbox User's Guide
  Go to function:
    Search    Help Desk 
get    Examples   See Also

Get property of database connection or cursor structure

Syntax

Description

value = get(conn, 'propertyname') gets the value of propertyname for the database connection, conn.

Allowable property names and returned values for conn are

autocommit
status of the autocommit flag, either on or off, as specified by set
driver
driver used for the JDBC connection, as specified by database
handle
identifying number for the connection
instance
name of the data source for an ODBC connection or the database for a JDBC connection, as specified by database
message
error message returned by database
URL
for a JDBC connection only, the JDBC URL structure, jdbc:subprotocol:subname, as specified by database
username
user name required to connect to the database, as specified by database; note that you cannot use get to retrieve password
:

value = get(cursor, 'propertyname') gets the value of propertyname for the cursor structure, cursor.

Allowable property names and values for cursor are:

attributes
cursor attributes
data
data in the cursor structure data element
message
error message returned from exec or fetch
rowlimit
maximum number of rows to be returned by fetch, as specified by set
sqlquery
SQL statement for the cursor, as specified by exec

value = conn.propertyname gets the value for the specified connection propertyname.

value = cursor.propertyname gets the value for the specified cursor propertyname.

For command line help on get, use the overloaded methods:

Examples

Example 1 - Get connection property, data source name

Connect to the database, SampleDB. Then get the name of the data source for the connection and assign it to AA:

MATLAB returns:

Example 2 - Get a connection property, autocommit flag status

Determine the status of the autocommit flag for connA:

Example 3 - Display data in cursor

Display the data in cursorA:

or type:

MATLAB returns:

cursorA contains one column with four records.

See Also

attr, cols, columnnames, database, fetch, rows, width, set

[ Previous | Help Desk | Next ]