DbPool object (Object/NES)

An object of the class "DbPool" which provides a means of pooling connections to multiple databases.

Availability:

JavaScript - 1.2
Netscape Enterprise Server - 3.0
JavaScript syntax:NESmyDbPool = new DbPool();
NESmyDbPool = new DbPool(aType, aServer, aUser, aPassword, aDb);
NESmyDbPool = new DbPool(aType, aServer, aUser, aPassword, aDb, maxCon);
NESmyDbPool = new DbPool(aType, aServer, aUser, aPassword, aDb, maxCon, aFlag);
Argument list:aTypeA database type
aServerA data source name or server name
aUserA user identifier
aPasswordA valid password for the user
aDbA database name if required by the data source
maxConA number indicating maximum connections
aFlagCommit/rollback flag value
Object properties:prototype
Object methods:connect(), connected(), connection(), disconnect(), majorErrorCode(), majorErrorMessage(), minorErrorCode(), minorErrorMessage(), storedProcArgs(), toString()

In JavaScript 1.2, you can connect to multiple databases and reuse connections. Each database can have a pool of available and ready connections which can be created when needed.

A DbPool object is created in a similar way to when you connect a single database object to a database. In this case however, you create a new DbPool object each time so you could maintain connections to several databases which is not possible with a plain (JavaScript 1.1) database object.

To create an object instance of the DbPool class, use the new operator on the DbPool() constructor.

The database type would likely be one of:

The server value would identify one of the available data source names.

The user and password details would correspond to valid users you have already created on your database server.

Likewise the database name, although for some databases such as Oracle, this may be done through the data source description and so the argument should be left blank in that case.

The maximum number of connections depends on your licensing arrangements with your database supplier and the capacity of your server and whether it needs to share connections with other services.

The commit flag indicates whether to commit (true) or rollback (false) a pending transaction.

See also:database.connect(), Netscape Enterprise Server, unwatch(), watch()

PropertyJavaScriptJScriptNIEOperaNESECMADOMCSSHTMLNotes
prototype1.2 1.2 n/a n/a n/a n/a3.0 3.0 n/a n/a n/a n/a-

MethodJavaScriptJScriptNIEOperaNESECMADOMCSSHTMLNotes
connect()1.2 1.2 n/a n/a n/a n/a3.0 3.0 n/a n/a n/a n/a-
connected()1.2 1.2 n/a n/a n/a n/a3.0 3.0 n/a n/a n/a n/a-
connection()1.2 1.2 n/a n/a n/a n/a3.0 3.0 n/a n/a n/a n/a-
disconnect()1.2 1.2 n/a n/a n/a n/a3.0 3.0 n/a n/a n/a n/a-
majorErrorCode()1.2 1.2 n/a n/a n/a n/a3.0 3.0 n/a n/a n/a n/a-
majorErrorMessage()1.2 1.2 n/a n/a n/a n/a3.0 3.0 n/a n/a n/a n/a-
minorErrorCode()1.2 1.2 n/a n/a n/a n/a3.0 3.0 n/a n/a n/a n/a-
minorErrorMessage()1.2 1.2 n/a n/a n/a n/a3.0 3.0 n/a n/a n/a n/a-
storedProcArgs()1.2 1.2 n/a n/a n/a n/a3.0 3.0 n/a n/a n/a n/a-
toString()1.2 1.2 n/a n/a n/a n/a3.0 3.0 n/a n/a n/a n/a-