Terminate a connection

The HCL OneDB™ ESQL/C program can use the following statements and functions to close a connection:
  • The CLOSE DATABASE statement closes a database. For applications before version 6.0, it also closes the connection. For applications of Version 6.0 and later, the connection remains open after the CLOSE DATABASE statement executes.
  • The sqlexit() library function closes all current connections, implicit and explicit. If you call sqlexit() when any databases are still open, the function causes any open transactions to be rolled back.
  • The sqldetach() library function closes the database server connection of the child process. It does not affect the database server connection of the parent process.
  • The DISCONNECT statement closes a specified connection. If a database is open, DISCONNECT closes it before it closes the connection. If transactions are open, the DISCONNECT statement fails.