Availability: |
| |||
JavaScript syntax: | NES | database.connect(aType, aServer, aUser, aPassword, aDb); | ||
NES | database.connect(aType, aServer, aUser, aPassword, aDb, maxCon); | |||
NES | database.connect(aType, aServer, aUser, aPassword, aDb, maxCon, aFlag); | |||
Argument list: | aDb | The name of a database | ||
aFlag | Commit or roll back on close | |||
aPassword | A valid password for the user | |||
aServer | The name of a database server | |||
aType | A valid connection type | |||
aUser | A user registered for database access on the server | |||
maxCon | The 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:
ORACLE
SYBASE
INFORMIX
DB2
ODBC
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() |
Prev | Home | Next |
database.commitTransaction() | Up | database.connected() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |