Connecting to Ingres from Eclipse

This section contains the following topics:

Required Software

Install Plug-ins

How You Connect to Ingres from Eclipse

Create a Connection Profile

Define an Ingres Driver

Create a New Database Connection

Connect to a Database

Create an SQL Scratch File

Previous Topic

Next Topic

Required Software

To connect to Ingres from the Eclipse SDK, you must download and install the following software and necessary plug-ins, which you can obtain from the Eclipse Data Tools Project page at http://www.eclipse.org/datatools/.

The required versions are described in the Ingres readme.

Previous Topic

Next Topic

Install Plug-ins

You can check which plug-ins your copy of Eclipse has by accessing the Eclipse Help menu. If your copy of Eclipse does not have the required versions, you must download and install them.

To install a plug-in

  1. Extract the downloaded plug-in into your Eclipse plug-in area.
  2. Re-start Eclipse to load the plug-ins.

Previous Topic

Next Topic

How You Connect to Ingres from Eclipse

The process for connecting to Ingres from the Eclipse SDK is as follows:

  1. Create a Connection Profile.
  2. Define an Ingres driver.
  3. Create a new database connection.
  4. Connect to a database.
  5. Create an SQL scratch file.

Note: Before you connect to Ingres, ensure that your Ingres instance is running.

Previous Topic

Next Topic

Create a Connection Profile

To connect to Ingres, you must create a Connection Profile. You can create a connection file from Eclipse's Database Development perspective.

Note: Depending on the development language you are using, you must use the appropriate connection method. The following procedure instructs how to create a JDBC connection profile. For more information on JDBC connectivity, see the Connectivity Guide.

To create a JDBC connection profile

  1. Click Window, Open Perspective, Other in the Eclipse SDK.

    The Open Perspective dialog appears.

  2. Select the Database Development perspective and click OK.

    The Data Source Explorer tab is added to the SDK.

    Data Source Explorer Tab

  3. In the Data Source Explorer, right-click the Database folder and select New from the context menu.

    The New Connection Profile dialog appears.

  4. Select the "Ingres JDBC Connection" wizard and click Next.

    The Create connection profile panel is displayed.

  5. Enter a name and description for your connection.

    For example:

    Create Connection Profile

    Click Next.

    The Specify a Driver and Connection Details panel is displayed.

If you have already defined an Ingres driver, proceed to Create a New Database Connection. If you need to define a driver, continue with Define an Ingres Driver.

Previous Topic

Next Topic

Define an Ingres Driver

Note: If you have not defined an Ingres Driver, you must define one. If you have already defined an Ingres driver, skip to Create a New Database Connection.

To define an Ingres driver

  1. On the Specify a Driver and Connection Details panel of the wizard, click the Browse button next to the Select a driver drop-down menu.

    The Driver Definitions dialog appears.

    Driver Definitions dialog

  2. If no driver is listed in the Ingres 2006 branch, select the Ingres branch and click Add.

    The New Driver Entry dialog appears.

    New Driver Entry dialog

  3. In the Available Driver Templates list, select Ingres JDBC Driver.

    The Driver Name field will contain: Ingres JDBC Driver.

  4. Ensure that the Edit New Driver Instance Immediately option is selected, and then click OK.

    The Edit Driver Entry dialog appears.

    Note: In most cases Eclipse will be unable to locate the driver file.

  5. Select the Driver File iijdbc.jar and click Edit Jar/Zip. Browse to your Ingres Instance system area (defined in the Ingres system variable II_SYSTEM) then to the subdirectories: ingres, lib to locate and select the driver file.
  6. Ensure that the other driver details, including the Driver Class (com.ingres.jdbc.IngresDriver) and the instance ID (for example, II) are correct. For example:

    Edit Driver Entry

    Note: You can specify User credentials at connect time, rather than on the generic driver form.

    Click OK.

  7. In the Driver Definitions dialog, select the Ingres JDBC Driver from the list.

    Driver Definitions dialog

    Click OK.

Continue with Create a New Database Connection.

Previous Topic

Next Topic

Create a New Database Connection

After you have created an Ingres JDBC Driver, you can create a new database connection using this driver.

To create a new database connection

  1. Select the Ingres Driver from the list of Available Driver Definitions.
  2. Specify the database name in the New JDBC Connection Profile dialog.

    Note: You must specify the database name in the URL field. For example: jdbc:ingres://localhost:II7/demodb

    Specify a Driver and Connection Details

    If your current user ID is not a valid Ingres user you must also specify User name and Password values. We recommend using the user credentials of the Ingres instance owner.

  3. Test the connection by clicking Test Connection.
  4. Click Finish to close the profile wizard.

    An Ingres database is listed in the Data Source Explorer. For example:

    Data Source Explorer with Ingres Listed

Previous Topic

Next Topic

Connect to a Database

After you have created a database connection profile, you can connect to the database from the Data Source Explorer.

To connect to a database

  1. Open the Databases root folder in the Data Source Explorer.

    Data Source Tab - Available Data Sources

    Available databases are listed.

  2. Right-click on the Ingres database and select Connect from the context menu.

    The connection is established. For example:

    Data Source Tab -- Connect by Clicking on Ingres DB

    You can now explore the objects in your database.

Previous Topic

Next Topic

Create an SQL Scratch File

An SQL scratch file is required to work with the database, and the file must belong to an Eclipse Project. If you have not created an Eclipse project, you must create one by clicking File, New, General Project. You can then create an SQL scratch file in the Eclipse SDK and connect it to a database.

To create an SQL scratch file

  1. Click File, New, Other.

    The New dialog appears.

  2. Open the SQL Development folder and select the SQL File wizard.

    For example:

    Select a wizard

    Click Next.

    The SQL File wizard appears.

  3. Select the parent folder.

    The folder name is the same as the project name.

  4. Enter a file name.

    For example, "IngresDemoSqlFile":

    New SQL File dialog

  5. Set the connection details as shown, and then click Finish.

    The Eclipse editor opens the new SQL file you created.

    Create an SQL Scratch File (x)

    The SQL scratch file is connected to the database.

    You can now issue SQL requests. Use the context menu or shortcut keys to execute your request. For example:

    Connected to Database


© 2007 Ingres Corporation. All rights reserved.