[Contributed by Zachi Klopman]
For an existing SQL file:
- Right click on the editor (not on the explorer). Choose «set connection info».
- You will be asked for a connection profile type and name. Assuming this is the first time, you will need to create on, so click on the [Create…] button.
- A new dialog will appear – click on «SQL Model-JDBC Connection» and then [Next>].
- Give your new connection a name (say, «xtz») and an optional description. (You may also choose auto-connect at this stage). Then [Next>].
- You need to select a driver. Assuming this is the first time, you will need to create one – click on […]. A new dialog «Driver Definitions» will open.
- Scroll to Informix, choose appropriate version and click [Add…]
- A new dialog «New Driver Definition» will open. Choose «Informix JDBC Driver» template, give a name, set «Edit New Driver Immediately» and [OK].
- Point to the location of the ifxjdbc.jar file.
- In the URL line you must set the host, port, database (important!) and INFORMXISERVER. you may also set a user id, password and database name in the following lines.
- Click [OK].
- Now choose the driver you just created and [OK].
- You will now have the details filled in, and you can change them at will – and always remember to [Test Connection]!.
- If you get «Ping succeeded!», you are fine, and click [Finish]. You can now hook up to the database and do other useful stuff.
If you get «Ping Failed», look at [details]. Here are some easy problems to fix:
Wrong hostname or port:
java.sql.SQLException: com.informix.asf.IfxASFException: Attempt to connect to database server (<INFORMIXSERVER>) failed.
Wrong database name (or no connect permission):
java.sql.SQLException: Database not found or no system permission.
java.sql.SQLException: Incorrect password or user com.informix.asf.IfxASFRemoteException: u...@host.domain is not known on the database server.
As an exercise for the reader, figure out what this error message means:
java.sql.SQLException: User (com.informix.asf.IfxASFRemoteException: infor...@host.domain)'s password is not correct for the database server.