How To
Mimer SQL and DbVisualizer using JDBC on Mac OS X
Categories: JDBC, Tools and Interfaces

From Mimer SQL version 9.2.4, the SQL tool DbVisualizer™ is bundled into the Mimer SQL distribution. DbVisualizer is a powerful, cross-platform database tool built on Java and using JDBC to connect to databases.

This article will show how to connect to Mimer SQL using JDBC on Mac OS X, with DbVisualizer as the example.


Install products
First, install Mimer SQL for Mac OS X. The software will by default end up in the /Applications directory with subdirectories like bin, lib, doc and examples under a main directory. In addition, applications like Mimer SQL Database Install, Mimer SQL Database Admin and DbVisualizer are installed:

Links to achieve a proper behavior of executables, man pages and library lookup will be made to system locations such as /usr/bin, /usr/lib and /usr/man (or corresponding). The Mimer JDBC Driver that we are going to use in this example will be found as /usr/lib/mimjdbc3.jar.

You can find Mimer SQL for Mac OS X in the Mimer SQL Download Page.

Create a Mimer SQL database
As said before, Mimer SQL is by default installed under /Applications. To create a database, use the Finder application to start the Mimer SQL Database Install application found in the main directory of the Mimer SQL installation, e.g. /Applications/MimerSQL-9.2.4D.

When this application opens up you should decide a name of your database and a password for the Mimer SQL database ident (user) called SYSADM. This is the database user that is referred to as the System Administrator for the database. If you want a sample database model with some data to play around with in DbVisualizer, check the box for "Populate the database with an example environment" found under Database Options. For now you can use default values for all other options available, so click the Install button to start the operation.

The Mimer SQL Database Install screen:

Connect to the database using JDBC
Start the DbVisualizer tool and select the "Driver Manager" entry under the "Tools" menu. Mimer SQL is a predefined database in DbVisualizer, i.e. the JDBC driver setup is prepared. Select "Mimer" in the list of drivers and use the Load File button to the right to point out the Mimer JDBC Driver, /usr/lib/mimjdbc3.jar.

Before loading the driver:

And after:

Note! About the URL to be used, see the following example:

...where:   – is the computer node where the database server resides.
1360   – is the TCP/IP port number (1360 is registered for Mimer SQL).
m92pelle   – is the name of the created Mimer SQL database.

Navigate to "Create Database Connection" entry in the "Database" menu. Use the wizard that starts up and enter a name for the connection you are going to establish, let's say mimdb_con.

Click Next and you are getting into the form where the database JDBC driver is selected. Use the combo box and select "Mimer" which now should be ready to use. Click Next and enter your database name, username and password and click the Test Connection button. If you decided to load the example environment you can use 'MIMER_STORE' as user name and 'GoodiesRUs' as password (else 'SYSADM').

Click "Finish" to exit the wizard and your connection is ready to use.

Now you have your connection named mimdb_con in the DbVisualizer list of connections to the left, where you can navigate around among the objects known to the MIMER_STORE user.

When you are connected to the database you can use the Database Info and Data Types buttons to look at details about Mimer SQL.

Now you are ready to explore all the functionality that the combination of Mimer SQL and DbVisualizer brings you!

For example, list the source for a trigger definition:

Or, try the SQL Commander. You can get some ideas on SQL statements you can use towards the MIMER_STORE example environment from the article The Example Database, see the "Examples" chapter:


Error codes
If DbVisualizer gets an error from the database a message is retrieved from the database server. But in cases when the database cannot be attached a quite sparse error message is given, like "Mimer error -18901 mimdb" if the database server isn't started. To translate the Mimer SQL error code into a text message, use the tables found in the Programmer's Manual part of the Mimer SQL Documentation Set. Look for the section called Internal Mimer SQL Return Codes in the Return Codes chapter (Appendix B).

For specific Mimer JDBC return codes, use the following command from a Terminal window:

java -cp /usr/lib/mimjdbc3.jar com.mimer.jdbc.Driver -errors

Connection cannot be established
Initially it can happen that a connection cannot been established from DbVisualizer. Usually the xinetd daemon needs to be restarted and forced to read the configuration file:
$ ps ax | grep inetd
45 ?? Ss 0:00.02 xinetd -dontfork -stayalive -inetd_compat -pidfile /var/run/
4608 p1 S+ 0:00.01 grep xinetd
$ kill -hup 45

By sending the SIGHUP signal to the PID of the xinetd process this is achieved.

For further details on Mimer SQL and JDBC please see the article about JDBC as database API.

Also, see the Mimer JDBC Driver Guide.

More information on the DbVisualizer tool can be found here.

Last updated: 2005-09-30


Powered by Mimer SQL

Powered by Mimer SQL