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

Close database connection or cursor

Syntax

Description

close(conn) closes the database connection, conn.

close(cursor) closes the cursor structure, cursor, that was returned by fetch or exec.

Database connections and cursors remain open until you close them using the close command. Always close a cursor or connection when you finish using it so that MATLAB stops reserving memory for it. Also, most databases limit the number of cursors and connections that can be open at one time.

If you terminate a MATLAB session while a cursor and connection are open, MATLAB closes them, but your database might not free up the connection or cursor. Therefore, always close connections and cursors when you finish using them.

Close a cursor before closing the connection used for that cursor.

For command line help on close, use either of the overloaded methods:

Examples

To close the cursor curs1 and the connection connA, type:

See Also

database, exec, fetch

[ Previous | Help Desk | Next ]