PSConnectionClass

Allows you to connect to a database, obtain or clear database errors, and create database cursors. You must assign a variable of the PSConnectionClass type before you can create an instance of the object or call methods on it.

Syntax

Syntax with user name and password

PSConnectionClass ( pageContext, Driver, URL, user, password, 
{bTrace} )

Syntax with database properties

PSConnectionClass ( pageContext, Driver, URL, Properties, 
{bTrace} )

Constructors

PSConnectionClass constructor

Datatype

Description

pageContext

PageContext (javax.servlet.jsp class)

The implicit pageContext object available to JSP targets.

Driver

String

The name of the JDBC driver used to connect to the database.

URL

String

The location of the database to which you want to connect. The database URL is obtained from the database JDBC driver documentation.

user

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.

Properties

String

Any properties that your JDBC driver uses to connect to the database. If properties are defined, you must also define the user ID and password in the properties that you list.

bTrace (Optional)

boolean

Allows tracing if set to true. The default is false.

Methods

PSConnectionClass method

Description

ClearError

Clears the list of error objects

CreateCommand

Creates a named object that represents a SQL statement

CreateCursor

Creates a database cursor

GetError

Returns the first error object