Database Application Basics

From InterBase
Jump to: navigation, search

Go Up to Installing InterClient Classes into JBuilder


If you want your JBuilder application or applet to connect to a database, use a Database component to establish the connection, a DataSet component (such as a TableDataSet or QueryDataSet component) to provide the data, and a data-aware control (such as a GridControl) to display the results. Follow these steps for any JDBC driver. What distinguishes InterClient from other JDBC drivers is the values you specify for the connection parameters of the Database component.

When you edit the connection properties of a Database component, JBuilder displays the Connection dialog.

Connection dialog

To connect to an InterBase database with your Java application/applet, you need to specify the following connection parameters: the name of a JDBC driver class, a username, a password, and a connection URL. The name of the InterClient JDBC driver class is always the same:

interbase.interclient.Driver

Spelling and capitalization are important. If you spell the driver class incorrectly, you may get a ClassNotFoundException, and consequently, a “No suitable driver” error when the connection is attempted. The username and password parameters are the same that you would use when connecting to a database with IBConsole or any other tool. For the sake of simplicity, these examples use <sysdba> (the InterBase root user) and <masterkey> for username and password, respectively.

There are other useful features of this dialog, as well. Once you fill in your URL, you can press the Test connection button to ensure that the connection parameters are correct. The Prompt user password check box forces the user to enter a proper username and password before establishing a connection. The Use extended properties check box and property page is not used by InterClient.

Advance To: