Connection Property Editor

This is a feature of JBuilder Professional and Enterprise.

Use the Connection property editor to connect to a database server.

To display this dialog, select the connection property in the Inspector when a Database component is highlighted in the structure pane.

This property editor contains two pages:



General page

Use the General page to set options commonly used when accessing a database. The property values contained on the General page of this dialog are stored in the ConnectionDescriptor object.

Choose Existing Connection

Selecting this button displays a dialog box that contains a list of URLs to which a connection has most recently been established. Selecting an URL from this list fills in the remaining fields of this dialog with the appropriate information.

Driver

Specify the driver class to use when connecting to the database so that JBuilder registers the driver class with JDBC and loads it in memory before attempting the database connection.

There are several drivers in the list. Drivers shown in black text in this list are already available to be used without further setup. Drivers shown in red text have not been defined as libraries in JBuilder, and you need to do this before using them. If you don't know how to make a driver available as a library in JBuilder, see "Adding a JDBC driver to JBuilder" in the Database Application Developer's Guide, for a discussion of adding a JAR file to the classpath and defining it as a library.

The JDBC-ODBC driver can be used within JBuilder without further setup. The JDataStore and InterClient drivers can be set up easily to be used with JBuilder and may be shipped with different versions of JBuilder (see "Connecting to a database"). Some of the drivers must be obtained by other vendors and installed before they can be used to successfully connect to a database.

URL

Specify the Universal Resource Locator (URL) for the database connection. The format consists of the URL type ("JDBC" for JDBC database access), followed by driver-specific information, separated by colons. The driver-specific information is driver/server dependent. Refer to your driver documentation for more information on this property. It typically includes the driver name followed by the data source name. For example, to access the sample JDataStore database, the URL is: jdbc:borland:dslocal:/usr/local/jbuilder/samples/JDataStore/datastores/employee.jds

...

Click this button to display the Create URL dialog box, or the Create URL For JDataStore if the selected driver is the JDataStore driver, or the Open dialog if the selected driver is the InterClient driver, or the Create URL For Oracle if the Oracle driver is selected.

From the Create URL For JDataStore dialog, select Local or Remote. If you select Local, select Browse to open the Open dialog, and browse to the .jds file.

Username

Enter the user name authorized to access the server database.

Password

Enter the password of the specified Username for access to the server database. An asterisk (*) appears for each character that you type in this field. Passwords are not required for JDataStore databases.

Use Extended Properties

Select this if you want the properties defined on the Extended Properties page to be used when connecting to the database. This option allows specification of additional connection properties for those drivers that can use the extra information. Check your driver documentation for information on whether it supports this connection feature.

This property defaults to off, meaning that JBuilder uses only the properties listed on the General page when connecting to a database.

Prompt User Password

Select this if you want a prompt to appear each time the connection to the database is attempted.

Test Connection

Click this button to test whether the database connection can be opened with the properties specified in this dialog box. The results are displayed in the area beside the Test Connection button (Success, or Fail with an error message in the Message pane).



Extended Properties page

Use the Extended Properties page to define additional connection properties that your driver may be able to use. These properties are stored in an instance of a java.util.Properties object and are not required or supported by all drivers. Refer to your driver documentation to see if the Extended Properties page of this dialog is relevant.

Adding or changing the information on this page automatically sets the Use Extended Properties option on the General page, indicating that JBuilder should use these extended properties when making the database connection. By default, JBuilder does not use extended properties when making a database connection.

This page contains a properties table which displays the extended properties that either you have defined or the driver has specified. There are three columns in the table:

Each row in the table represents a distinct property.

Add Row

Creates an empty row in the table so that you can define a new connection property.

Remove Row

Deletes the current property by deleting the entire row of information on that property.

Use Driver Defaults

Accesses driver information and displays the properties in the properties table.