<< CSQL And JDBC - TOC - NetBeans IDE for JDBC Driver >>
This chapter draws an open source application called SQuirrel SQL Client that provides an easy-to-use interface to CSQL as well as a list of other vendor databases like MySQL, PostgreSQL, Oracle, Sybase, SQL Server and DB2.
SQuirrel, a graphical front end which supports JDBC-compliant databases, that can ease development efforts by allowing the developer to peek at database contents and also view the contents of tables. Additionally, SQuirrel’s well-disposed GUI provides a SQL area within which user can execute and test SQL commands.
You need to have Java 1.6x installed in your machine to run SQuirrel SQL Client. Follow the SQuirrel Client Home Page http://squirrel-sql.sourceforge.net/ to get more information about the required Java version.
Any of the squirrel-sql-xxxf-install.jar files can be downloaded from http://squirrel-sql.sourceforge.net/ . At the time of writing this manual, SQuirrel Client’s version is 2.6.9.
After downloading the package, go to your home directory and issue the below command,
$java –jar squirrel-sql-<version>-install.jar
Doing so will create a new directory named SQuirrelSQLClient in your home directory. In this manual, the directory is assumed as /home/Lakshya/SQuirrelSQLClient
Note: Open up one terminal in your machine, go to your CSQL root directory and start the CSQL database server before starting SQuirrel Client. Refer CSQLInstallation for starting csqlserver
In another terminal, execute setupenv.ksh file to set CSQL environmental variables and CLASSPATH, which is required for JDBC Driver.
$. ./setupenv.ksh
After running setup script, go to your SQuirrelSQLClient directory, and execute the squirrel-sql.jar file.
$cd SQuirrelSQLClient $java –jar squirrel-sql.jar
First, we need to create a Driver and Alias in SQuirrel to work with CSQL database.
Go to Drivers in the main toolbar and select New Driver from the drop-down menu, a pop-up titled Add Driver' appears. Configure CSQL driver as mentioned below:
Name: Type in the name you want here for the driver. Example:CSQLEmbedded
Example URL: jdbc:csql
Click on Extra Class Path tab and then click Add button, Select the CSQL JDBC driver jar file (CsqlJdbcDriver.jar) , which is present under install/lib directory of the CSQL installation directory.
Return to the Java Classpath tab, at the bottom, there is a drop-down box. Paste the following class name:csql.jdbc.JdbcSqlDriver
Click OK
To interact with database using SQuirrel, you have to create an Alias. Go to Aliases in the main tool bar and select New Alias from the drop-down menu. In the resulting pop-up, enter the following
Name: Type a name of your choice for the alias (Example: CSQLEmbeddedAlias)
Driver: choose the driver that you configured above URL.(it is CSQLEmbedded)
URL: jdbc:csql
User Name: user name will be root to access CSQL database
Password: It will be manager
Click OK
Now you will see your newly created Alias in the Alias Scrollable list.
Double click the Alias that you created (CSQLEmbeddedAlias). A pop-up will appear Click on Connect Now it is connected to the CSQL database
Now you will face a window that represents the configured database. On the left-hand pane, you can view the tables, the schema of the tables and the contents of the tables.
To execute SQL queries, select the SQL tab, enter your query, select the query and click on the running-man icon. You will see the results of your SQL statements in the resulting pane.
<< CSQL And JDBC - TOC - NetBeans IDE Configuration for JDBC Driver >>