Jisql is a Java based utility to provide a command line interactive session with a SQL server. This application is conceptually modeled on the Sybase 'isql' program with, obviously, strong similarities to Microsoft SQL/Server isql and osql (as Microsoft got SQL Server from Sybase).
The program can act in a similar way to Oracle's sqlplus and PostgreSQL's psql.
The complete Jisql package (source code, Javadoc, build environment) can be downloaded from:
Windows users: There seem to be problems with WinZip and the tar.gz version of the archive if you open it directly without saving it to disk. The zip version works just fine.
About Java versions: These files have been compiled with Java 6. There is now a call to a Java 1.6 only class (the Console class) that forces you to use Java 1.6 and above. However, a pretty simple change in Jisql.java would remove this dependency. Since any Java version below 1.6 is no longer supported by Oracle I figured that this would be ok.
These files contain a precompiled jar file along with all of the source code and an ant build file.
A simple command line might look like (this should be all on one line)
is:
java -cp lib/jisql-2.0.11.jar:lib/jopt-simple-3.2.jar:
<jar for native driver>
com.xigole.util.sql.Jisql
-user scott -password blah -driver postgresql
-cstring jdbc:postgresql://localhost:5432/scott -c \;
This logs into a PostgreSQL database as the user "scott", password "blah". It connects to the database named "scott". It uses the command terminator of ";", just like psql or sqlplus (which is escaped in the example so that it will not be interpreted by the Unix shell). If you do not use this the default is the term "go" on a single line like Sybase's isql or MS/SQL's isql/osql. Note that this command line sample does not use the included javacsv.jar so you could only use the XML or default output formatter (see below for more information).
New in version 2.0.x
The biggest change in version 2 is the addition of separate output formatters. Basically
this allows you to more easily customize the output for your application. There are three
formatters that are included with the distribution:
There is now a dependency on JOpt Simple in for the base configuration. Additionally, if you are using the CSVFormatter then it is dependent on Java CSV.
New in version 2.0.5
There is a bit better versioning information available. The jar has been renamed to
include the version so that you can quickly see what you're running. This same version
information is included in the code (run with -help or with no arguments to see the version)
and in the jar manifest.
Options:
Important - each JDBC vendor has other flags and parameters that can be passed on the connection string. You should look at the documentation for your JDBC driver for more information. The strings listed are just a sample and may change with a new release of the driver. None of these strings are coded within the application - the list is provided for reference only.
The included default formatter supports the following command line options:
The include CSV formatter supports the following command line options:
The included XML formatter does not have any additional output options.
New! - if you're having any issues with jisql, come and discuss it in our forums.
Copyright (C) 2004-2011 Scott Dunbar (scott@xigole.com)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.