database.disconnect()

NES2+Syntax

							database.disconnect()

Description

The disconnect method of the database object disconnects a connection to a database.

Example

Listing 8.43 creates a connection to an Oracle database. It takes a user's UID and name that was passed in, runs a query (based on the UID) against the database to find that user's information, and updates his or her name. If a connection is not made, the error code and message are returned to the screen. Once the processing has been completed, the connection is dropped using the disconnect() method.

Listing 8.43 Disconnecting from a Database Using the disconnect() Method
 <SERVER> // Assign the user submitted ID and name to the client object as properties client.uid = request.uid; ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.