SQuirreL Client

1. Introduction

The SQuirreL SQL client uses JDBC to allow users to explore and interact with databases via a JDBC driver. It provides an editor that offers code completion and syntax highlighting for SQL. SQuirreL is written in Java, so it is multiplatform.

Plugins can be added to modify the application’s functionality.

2. Installation

2.1. Installing SQuirreL

2.1.2. Installing on Linux

  • Run the .jar installer:

    java -jar squirrel-sql-4.1.0-standard.jar
  • Follow the installation guide:

start

info

dir

target

progress

shortcuts

scripts

Run Client

To start the client, use the provided menu item in your desktop environment:

scripts

Or you can start it from the install directory too:

user@host:~$ cd squirrel-sql-4.1.0/
user@host:~/squirrel-sql-4.1.0$ ./squirrel-sql.sh

The application opens, by default together with the help window.

What’s next

With the application installed, you can now add the LeanXcale drivers.

2.1.3. Installing on macOS

  • Run the .jar installer:

    java -jar squirrel-sql-4.1.0-MACOSX-install.jar
  • Follow the installation guide:

start

info

dir

target

progress

shortcuts

scripts

Run Client

To start the client, use the provided startup script in the installation directory:

squirrel-sql.sh

2.1.4. Installing on Windows

  • Run the .jar installer :

    java -jar squirrel-sql-4.1.0-standard.jar
  • Follow the installation guide:

start

info

dir

target

progress

shortcuts

scripts

Run Client

To start the client, use the provided menu item. You can press the Windows key and then start typing SQuirreL until you see the application appear:

scripts

You can also start SQuirreL using the squirrel-sql.bat file inside the install folder.

2.2. Install JDBC driver

You can download the Java JDBC driver (jar with dependencies) for LeanXcale from the Drivers page.

To install the driver, copy the .jar file you downloaded and paste it into the lib directory inside of your SQuirreL install directory. For instance, in Linux you would do:

user@host:~$ cp qe-driver-1.7.3-jar-with-dependencies.jar /home/user/squirrel-sql-4.1.0/lib
  • Open SQuirreL

  • Open the Drivers tab and press the + icon:

active_driver

  • Choose from the list the qe-driver jar that you copied in previous steps and fill the information as in the picture. The important information is:

    • Example URL: jdbc:leanxcale://{server}:{port}

    • Class Name: com.leanxcale.client.Driver

options

  • Click OK and you’ll see that the driver is now correctly configured by looking at the blue mark at the side of the driver name and the green text at the bottom:

active_driver

It’s ready, so you can now set up the connection.

2.3. Setting up the connection

In SQuirreL, database connections are called Alias, so go to the Alias tab and click the + button: Connection example

Fill the required form data:

  • Name: put a name to the connection to your database

  • Driver: the LeanXcale Driver

  • URL: jdbc:leanxcale://{Your server name or IP address}:{Port}/{Your database}{;property=value{;property=value}}

  • User Name: the user name of your database

  • Password: the password of your database

The image below shows an example of a connection setting:

Connection example

Take into account that if you have Security enabled in your LeanXcale installation, you must add the property "secure=true" to your URL:

jdbc://leanxcale://54.236.231.17:1529/analyticalGIS;secure=true

Note: Keep in mind that you need to have previously added your TLS certificate to your trusted ca certificates store. Check how to do it here. In addition, you must have the JAVA_HOME environment variable defined, so that Squirrel starts with the JVM corresponding to the Java installation of your system. If not, it will boot with a default embedded JVM that will not be able to find your certificates store.

If you want to test the connection, just click on the Test button and then on Connect. If SQuirreL connected successfully to LeanXcale, you should see the "Connection successful" dialog:

Connection example

Click OK in the Add Alias window and you’re set to go.

3. Usage Examples

3.1. Connecting to the database

To use the LeanXcale connection you just created, open the Alias tab and double-click over the connection name:

Connecting to the database

Then click the Connect button on the next screen:

Connect to

You’ll see the SQuirreL interface and you can start typing SQL commands:

SQuirreL interface

3.2. Creating a table

Change to the SQL tab, write the CREATE TABLE query and press Ctrl+Enter:

SQuirreL Create table

3.3. Inserting rows

Change to the SQL tab, write the INSERT query and press Ctrl+Enter:

SQuirreL Insert rows

3.4. Listing tables

To see the tables in your schema and its details, go to the Objects tab, open your schema (USER1 in the image) and open the TABLE element of the tree. If you want to see information about a specific table, you can click in the table name (PERSONS in the image) and then in the tabs at the right. In the image, you can see that clicking over Columns gives you the list of columns of the table:

SQuirreL List tables

3.5. Querying a table

After clicking over the name of the table that you want to see its data, click on the Content tab to see the content you inserted in the table:

SQuirreL Query table

3.6. Querying a table in descendent order

If you want to order the table data you’re viewing, you can click on the name of the column once to order in ascendant order or twice to order it in descendant order:

SQuirreL Query table ordered