database.connect() (Method)

Forms a connection to the database using the database type to select the correct one.

Availability:

JavaScript - 1.1
Netscape Enterprise Server - 2.0
JavaScript syntax:NESdatabase.connect(aType, aServer, aUser, aPassword, aDb);
NESdatabase.connect(aType, aServer, aUser, aPassword, aDb, maxCon);
NESdatabase.connect(aType, aServer, aUser, aPassword, aDb, maxCon, aFlag);
Argument list:aDbThe name of a database
aFlagCommit or roll back on close
aPasswordA valid password for the user
aServerThe name of a database server
aTypeA valid connection type
aUserA user registered for database access on the server
maxConThe maximum number of simultaneous connections

When connecting to a database, you need to indicate the type of database you are connecting to. The following are examples of commonly available database types:

Use one of these values in the first argument to this method.

You will also need to know the name of your target server, a valid username and password and if multiple databases are supported by your database server, then you will need to know the name of the target database you want to connect to.

The last two arguments indicate the maximum number of connections available at once and a flag to indicate the commit policy on closure. You can elect to automatically commit any changes (dangerous) or roll back any uncommitted changes.

See also:DbPool object, DbPool(), DbPool.connect()