Database Toolbox Previous page   Next Page
close

Close database connection, cursor, or resultset object

Syntax

Description

close(object) closes object, freeing up associated resources.

Following are the allowable objects for close.

Object
Description
Action Performed by close(object)
conn
Database connection object created using database
closes conn
curs
Cursor object created using exec or fetch
closes curs
rset
Resultset object defined using resultset
closes rset

Database connections, cursors, and resultsets remain open until you close them using the close function. Always close a cursor, connection, or resultset 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 cursors and connections 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 the overloaded methods.

Examples

To close the cursor curs and the connection conn, type

See Also
database, exec, fetch, resultset


Previous page  clearwarnings cols Next page

© 1994-2005 The MathWorks, Inc.