SquirrelSQL

Table of Contents

Installation

Setting up SquirrelSQL client with PostgreSQL, MariaDB, MySQL and/or Sybase.

SquirrelSQL

Download:

http://squirrel-sql.sourceforge.net/#installation

Run the installer JAR:

java -jar squirrel-sql-X.Y.Z-install.jar

Check the PostgreSQL, MariaDB, MySQL and/or Sybase plugin checkboxes to include them in the install.

JCDB Drivers

PostgreSQL

http://jdbc.postgresql.org/download.html

Unpack the downloaded file, at copy the jar to the libs/ folder where you installed SquirrelSQL and restart the program.

MariaDB

https://downloads.mariadb.org/connector-java/ (Seems to require subscription - evaluation is available.)

Unpack the downloaded file, at copy the jar to the libs/ folder where you installed SquirrelSQL and restart the program.

MySQL

http://www.mysql.com/downloads/connector/j/

Unpack the downloaded file, at copy the jar to the libs/ folder where you installed SquirrelSQL and restart the program.

Sybase

  • JDBC 3
    • Copy the jconn3.jar from jConnect 6 to your SquirrelSQL libs/ folder. Found in the Connect-6_0/classes/ folder.
    • Start (or restart) SquirrelSQL.
    • Click the "Drivers" pane (to your utmost left) and scroll down to the "Sybase Adaptive Server Enterprise" driver.
    • Right-click it and choose "Copy driver".
    • Give the new driver a new name (presumably adding JDBC3 to the old name), and change the "Class name" from jdbc2 to jdbc3 - resulting with: "com.sybase.jdbc3.jdbc.SybDriver".
  • jTDS
    • Copy the jtds-1.2.5.jar from the jTDS zipfile to the SquirrelSQL libs/ folder.
    • (Re)start SquirrelSQL
    • Use the jTDS Sybase" or "jTDS Microsoft SQL" driver when creating aliases.
  • Note!

    SquirrelSQL acts strangely with Sybase unless you use 'GO' (with caps) as separator or change it to ';' (semicolon). It seems to work with semi-colon out-of-the, but queries with a where-clause fail with SQLState 37000, errorcode 102. The easiest way to resolve this is just to change the seperator to semicolon.

    This is done in the pane:

    File -> GlobalPreferences -> SybaseASE
    

Configuration

PostgreSQL

The default PostgreSQL configuration looks like this:

jdbc:postgresql:[<//host>[:<5432>/]]<database>

It's easily changed to:

jdbc:postgresql:database

MySQL/MariaDB

The default MySQL configuration looks like this:

jdbc:mysql://<hostname>[,<failoverhost>][<:3306>]/<dbname>[?<param1>=<value1>][&<param2>=<value2>]

It's easily changed to:

jdbc:mysql://localhost/database

Sybase

jConnect

The default jConnect configuration looks like this:

jdbc:sybase:Tds:<host>:<port>/<DBNAME>

It's easily changed to:

jdbc:sybase:Tds:localhost:portnumber/database

jTDS

The default jTDS configuration looks like this:

jdbc:jtds:sybase://<hostname>[:<4100>]/<dbname>[;<property>=<value>[;...]]

It's easily changed to:

jdbc:jtds:sybase://localhost:4100/database

Notes

Auto-commit

Remember to disable auto-commit (your not suicidal, are you?):

File -> New Session Properties -> SQL tab : uncheck Auto Commit SQL check-box.

Let's repeat that, shall we?

*File -> New Session Properties -> SQL tab : uncheck Auto Commit SQL check-box*.

Keybindings

  • C-Enter - Will execute the query that the cursor is on.

Numericals with commas

Disable the default behaviour of displaying numericals with commas:

  • Go to Global Preferences and then click on Data Type Control tab.
  • Scroll down to the bottom. In the "FLOAT, REAL, DOUBLE, NUMERIC" section, select "Use default format".

Sybase

SquirrelSQL acts strangely unless you use 'GO' (with caps) as separator or change it to ';' (semicolon). It seems to work with semi-colon out-of-the-box, but queries with a where-clause fail with SQLState 37000, errorcode 102. The easiest way to resolve this is just to change the seperator to semicolon.

Sybase - JDBC 2

The 5.5 version of jConnect is the one working out-of-the-box - but you will receive an error from SquirrelSQL about it not being a JDBC ver.3 driver each time you connect.

You need the jconn2.jar file located in jConnect-6_0/classes/. It enables the "Sybase Adaptive Server Anywhere" and "- Enterprise" drivers in SQuirreL SQL.

Author: Rói á Torkilsheyggi

Created: 2016-03-16 Wed 00:07

Emacs 24.5.1 (Org mode 8.2.10)

Validate