Using SQuirreL

Russell Bateman
last update: 13 April 2010 

This article explains how to set up and use SQuirreL, an SQL viewer and editor. SQuirreL is a solution for any platform since it's written in Java. It is also an excellent browser since it supports nearly every RDBMS in existence, in particular, MySQL, which I use here as my illustration. The advantage of using SQuirreL over the native software that ships with each database is that the interface—and therefore your work habits—can remain the same. This isn't important if you ONLY work with one database. I have worked with 4 or 5 over the last few years and 3 simultaneously when I wrote this how-to.


Table of Contents

How to set up SQuirreL on Linux
How to set up SQuirreL on Windows
How to launch SQuirreL
Where to go from here?

How to set up SQuirreL on Linux

  1. Download SQuirreL installation JAR by clicking on the icon at the top of this page.
  2.  
  3. Run the installation JAR:
        russ@taliesin: ~/Downloads> java -jar squirrel-sql-3.1-install.jar
  4. Follow the installation steps as you normally would. Note that there are many options you'll want to include that depend on how you'll be using it.
  5.  
  6. If you prefer, create a launcher for your desktop or menu pane. The JAR to run is on the path, <installation-path>/squirrel-sql.jar. (There is an "acorn" icon under subfolder icons to use if you like.) Otherwise, you'll launch SQuirreL using the command:
        russ@taliesin:~/dev> java -jar squirrel-sql.jar
    			

How to set up SQuirreL on Windows

  1. Download SQuirreL installation JAR by clicking on the icon at the top of this page.
  2.  
  3. Run the installation JAR:
    • If on an earlier version of Windows than 7, go to the download directory and run the downloaded installation JAR:
          C:\Documents and Settings\russ\My Documents\Downloads> java -jar squirrel-sql-3.1-install.jar
    • If on Windows 7, launch as just noted, but do not attempt to install on C:\Program Files\squirrel-sql-3.1\ as proposed, but on a path that belongs to you (such as C:\Users\russ\dev\SQuirreL\).
     
  4. Follow the installation steps as you normally would. Note that there are many options you'll want to include that depend on how you'll be using it such as MySQL, Oracle, PostgreSQL, etc.
  5.  
  6. Create a shortcut for your desktop and/or start menu. Then edit the shortcut's properties to set the Target: field to C:\Windows\System32\java.exe -jar C:\Users\russ\dev\SQuirreL\squirrel-sql.jar if not already set to that.

    Change the Start in: path if you like. I set mine to the root of my development area (C:\Users\russ\dev).

    There is an "acorn" icon under subfolder icons to use if you like.

    My experience is that this is necessary on Windows 7. I haven't set up SQuirrel on previous versions of Windows since I principally use Linux anyway.


How to launch SQuirreL...

This set up is for MySQL as an illustration.

  1. Launch SQuirreL as implied in the above instructions.
  2.  
  3. Go to Windows -> View Aliases.
  4.  
  5. Click the blue plus sign to add an alias.
  6.  
  7. Name the alias (MySql-dvdcatalog).
  8.  
  9. Change the driver to MySQL Driver.
  10.  
  11. Change the URL to the one being used in your Java program, e.g.: jdbc:mysql://localhost/DvdCatalog
  12.  
  13. Change the username and password.
  14.  
  15. If you choose, click the Auto logon and/or Connect at Startup boxes. That way, it will come right up at launch on the database you're working on.
  16.  
  17. Click Test to see if it works.
  18.  
  19. If your driver is missing, (which it will be)...
    1. Go to Windows -> View Drivers.
    2. Double-click the (MySQL) driver.
    3. Fill out the dialog:
    4. Click OK.
  20.  
  21. Return to Windows -> View Aliases and double-click the alias you've already set up (to use MySQL). You should now see the database particulars (assuming you have a database already set up and working), for example,


Where to go from here?

The base assumption is that you already know how to peruse a database to look at its tables, rows and cells. If this is not the case, you might instead use MySQL's browser and follow the information at MySQL: The Database Browser. Or learn using other databases and database tutorials.

In this case, I just wanted a glimpse inside my database to see its tables as I built them from my application code. Comparing the previous illustration and this one here, you'll see how this is done.