PSConnectionParmsClass

Specifies the database connection parameters required for a Web DataWindow control to connect to a database. The object does not connect to the database.

Unless you use the two-argument syntax, you need to be familiar with the connection parameters for your database system before using this object. The Connecting to Your Database book provides information about making database connections.

Syntax

Syntax with single argument

PSConnectionParmsClass(connectString)

Syntax with two arguments

PSConnectionParmsClass(DBProfile, Prop)

Syntax with multiple arguments

PSConnectionParmsClass(connectString, username, password, dbms, lock, database, serverName)

Constructors

PSConnectionParmsClass constructor

Datatype

Description

connectString

String

The connection parameters required to connect to the database. This string is specific to the database driver for your database DBMS. It must not include spaces that are not part of the string value.

DBProfile

String

The connection parameters defined in the database.properties file in the \WEB-INF\classes directory. This file is created when you build the JSP target and its content is taken from the database profiles defined in PowerBuilder.

Prop

Boolean

This value is always “true”. It is used to distinguish the constructor syntax with the DBProfile argument from the syntax with the connectString argument.

username

String

The user name that the object uses to connect to the specified database.

password

String

The password that the object uses to connect to the specified database.

dbms

String

The connection mechanism used to connect to the database.

lock

String

The lock value required by your database to prevent concurrent transactions for interfering with each other and compromising the data in the database.

database

String

The name of the database.

serverName

String

The name of the server that runs the database.

Examples

Example 1

The following example creates the connection object dbConn using the syntax with a single connectString argument:

PSConnectionParmsClass  dbConn = new PSConnectionParmsClass("ConnectString='DSN=EAS Demo DB V11;UID=dba;PWD=sql',ConnectOption='SQL_DRIVER_CONNECT,SQL_DRIVER_NOPROMPT'" );