DbPool.connected()

NES3+Syntax

							DbPool.connected()

Description

The connected() method of the DbPool object tells if the pool of connections to the database is still connected.

Example

Listing 8.57 creates a pool of connections and pulls a connection from the pool for processing. If the connection is made, any code within that section is executed. If the connection fails, the error is written to the page.

Listing 8.57 Testing a Connection with the connected() Method
 <SERVER> // Create a pool of connections var myPool = new DbPool("ORACLE", "mySID", "myApp", "appsPWD", "myTNS"); // Open a connection from the pool. Give error if connection could // not be made. var myConn = myPool.connection('Employees', 15); if (myConn.connected()) { // You ...

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.