SQuirreL SQL is one of the most popular options when it comes to SQL clients. In this article, we'll take a deep dive into the SQuirreL SQL client: what it is, what its benefits are, and how you can get started using it.
However, businesses have a number of options when it comes to SQL databases: Microsoft SQL Server, Oracle Database, MySQL, IBM DB2, and dozens of other alternatives. In order to deal with all this complexity, SQL clients attempt to provide a "one-stop shop" for users who need an easy way to interact with these different SQL database types, like a translator that speaks multiple languages.
SQL clients are software applications that let you view a relational database's model, browse the information inside the database, and create SQL queries. Just like you use a web browser on your computer to access websites stored on other machines, you use a SQL client to access data stored in a remote database. SQL clients attempt to put a more "human-friendly" face on the bits and bytes inside a relational database.
SQuirreL SQL is a client for accessing SQL databases through a user-friendly GUI (graphical user interface). Because SQuirreL SQL is written in the Java programming language, it can run on any computer with a JVM (Java Virtual Machine).
In addition, the SQuirreL SQL client is capable of interacting with any relational database that is compliant with the JDBC (Java Database Connectivity) interface. This includes the most popular relational databases, such as:
SQuirreL SQL is available from the project website ( ) as a JAR package file. The file name will take the form of "squirrel-sql-version-install.jar" or "squirrel-sql-version-MacOSX-install.jar" for Mac OS X systems, where version is the version of the SQuirreL SQL software.
When you open SQuirreL SQL, you should see a list of the different types of databases that the client supports. Each database should have either a blue checkmark next to it (indicating that the JDBC driver for that database is in your JVM classpath) or a red X (indicating that it is not).
java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/hadoop/hive/metastore/api/MetaException at java.util.concurrent.FutureTask.report(Unknown Source) at java.util.concurrent.FutureTask.get(Unknown Source) at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132) at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45) at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/hadoop/hive/metastore/api/MetaException at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:175) at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$000(OpenConnectionCommand.java:45) at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$1.run(OpenConnectionCommand.java:104) ... 5 moreCaused by: java.lang.NoClassDefFoundError: org/apache/hadoop/hive/metastore/api/MetaException at org.apache.hive.jdbc.HiveConnection.createBinaryTransport(HiveConnection.java:456) at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:182) at org.apache.hive.jdbc.HiveConnection.(HiveConnection.java:155) at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105) at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133) at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167) ... 7 moreCaused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.metastore.api.MetaException at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 13 more
Beeline can be run disconnected from a terminal for batch processing and automation scripts using commands such as nohup and disown.
Some versions of Beeline client may require a workaround to allow the nohup command to correctly put the Beeline process in the background without stopping it. See HIVE-11717, HIVE-6758.
Alternatively, you can run the following bash script, which will seed the data file and build your classpath before invoking the client. The script adds all the additional jars needed for using HiveServer2 in embedded mode as well.
In the current approach of using Kerberos you need to have a valid Kerberos ticket in the ticket cache before connecting. This entails a static login (using kinit, key tab or ticketcache) and the restriction of one Kerberos user per client. These restrictions limit the usage in middleware systems and other multi-user scenarios, and in scenarios where the client wants to login programmatically to Kerberos KDC.
The other way is to use a pre-authenticated Kerberos Subject (see HIVE-6486). In this method, starting with Hive 0.13.0 the Hive JDBC client can use a pre-authenticated subject to authenticate to HiveServer2. This enables a middleware system to run queries as the user running the client.
Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed by the client. The default value, used for every statement, can be specified through the JDBC connection string. This default value may subsequently be overwritten, per statement, with the JDBC API. If no value is specified within the JDBC connection string, then the default fetch size is retrieved from the HiveServer2 instance as part of the session initiation operation.
The JDBC fetch size is only a hint and the server will attempt to respect the client's requested fetch size though with some limits. HiveServer2 will cap all requests at a maximum value specified by the hive.server2.thrift.resultset.max.fetch.size configuration value regardless of the client's requested fetch size.
HIVE-10447 enabled the JDBC driver to support 2-way SSL in HTTP mode. Please note that HiveServer2 currently does not support 2-way SSL. So this feature is handy when there is an intermediate server such as Knox which requires client to support 2-way SSL.
In Hive version 3.0.0 HIVE-18447 introduced an option for clients to provide custom HTTP cookies that can be sent to the underlying server. Some authentication mechanisms, like Single Sign On, need the ability to pass a cookie to some intermediate authentication service like Knox via the JDBC driver.
The recommended value is setting timezone to 'auto'. Connector will then time_zone connection variable to `timezone` value at connection creation. This permits safe use of server time function.If the client uses the IANA timezone, the server might have to load time zone information. See mariadb-tzinfo-to-sql and time-zones, those are not filled by default.
The fastest way to load lots of data is using LOAD DATA INFILE.
However, using "LOAD DATA LOCAL INFILE" (ie: loading a file from the client) may be a security problem if someone can execute a query from the client, he can have access to any file on the client (according to the rights of the user running the client process).
Note that the server usually expects clients to read off the result set relatively quickly. The net_write_timeout server variable controls this behavior (defaults to 60s).If you don't expect results to be handled in this amount of time there is a different possibility:
The driver uses server prepared statements as a standard to communicate with the database (since 1.3.0). If the "allowMultiQueries" options are set to true, the driver will only use text protocol. Prepared statements (parameter substitution) is handled by the driver, on the client side.
Most of the time this will be caused by reading a query that has a large resultset; the server usually expects clients to read off the result set relatively quickly. The net_write_timeout server variable controls this behavior (defaults to 60s). If the client doesn't read the whole resultset in that amount of time, the server will discard the connection.If you don't expect results to be handled in this amount of time there is another possibility:
The JAR file containing the Caché JDBC driver is installed automatically by the Caché installer when installing a full Caché instance or when installing client components only. It can be found in the lib directory under the main installation directory.
I'm attempting to use Squirrel on a Windows system with a locally-installed version of Caché/Ensemble 2014.1. Unfortunately, the version of the JRE on that system is 1.6, with which Squirrel is incompatible. Updating the JRE to 1.8 allows Squirrel to work, but breaks the JDBC gateway and client functionality in Caché. Both applications check the JRE version in the Windows registry on initialization, so messing around with PATH and CLASSPATH don't solve the problem.
The different options that you can configure in the tool are managed using the "Global Preferences" window. Before using the tool,you should configure the driver you are going to use and the databases you areworking with. Only Sun JDBC ODBC Bridge is available by default. The MySQL JDBCdriver is located on Youhave then to create an "alias" for actual database you are going towork with. This allows you to connect to different databases using their ownparameters (name, user, and password). This is done easily create a connectionwith the parameters "jdbc:mysql://localhost/testsquirrel" on the test database that I have created.
3a7c801d34