database

NES2+Syntax

Core object is created when the database.connect() method is called.

Description

The database object represents a given connection to a database. This object has only one property, the prototype property, which you can use to add properties to the object. Table 8.6 lists the methods associated with this object.

Note

If you only need a pool of connections to the database, use the DbPool object for your connection to initialize a pool, and then use the Connection.connection() method to assign a connection.

Table 8.6. Methods of the database Object
MethodDescription
beginTransaction()Begins a new SQL transaction.
commitTransaction ()Commits the current SQL transaction.
connect()Connects to a particular database as a particular ...

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.