Xigole Systems
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.
Jisql 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.
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 -classpath lib/jisql.jar:<file containing 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 intpreted 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.
Options:
- -driver This option allows you to specify the JDBC driver class name of the driver. There are several shortcuts that can be used:
- jconnect4 - short for com.sybase.jdbc.SybDriver
- jconnect5 - short for com.sybase.jdbc2.jdbc.SybDriver
- oraclethin - short for oracle.jdbc.driver.OracleDriver
- db2app - the DB2 "App" driver - COM.ibm.db2.jdbc.app.DB2Driver
- db2net - the DB2 "Net" driver - COM.ibm.db2.jdbc.net.DB2Driver
- mssql - short for com.microsoft.jdbc.sqlserver.SQLServerDriver
- cloudscape - short for COM.cloudscape.core.JDBCDriver
- pointbase - short for com.pointbase.jdbc.jdbcUniversalDriver
- postgresql - short for org.postgresql.Driver
- mysqlconj - short for com.mysql.jdbc.Driver - the Connector/J driver for MySQL
- mysqlcaucho - short for com.caucho.jdbc.mysql.Driver - the Caucho driver for MySQL
- -cstring This option allows you to specify the connection string to the database. This string is driver specific but almost always starts with "jdbc:". Connection strings for the drivers I have tested look like:
- jconnect4 and jconnect5 - Sybase connection strings take the form "jdbc:sybase:Tds:[hostname]:[port]/[db_name]"
- oraclethin - The Oracle "thin" driver connection string looks like "jdbc:oracle:thin:@[hostname]:[port]:[oracle sid]"
- db2app - The DB2 "App" driver connection string looks like "jdbc:db2:[db_name]"
- db2net - The DB2 "Net" driver connection string looks like "jdbc:db2://[hostname]:[port]/[db_name]"
- mssql - The MS/SQL driver connection string looks like "jdbc:microsoft:sqlserver://[hostname]:[port]/[db_name]"
- cloudscape - The Cloudscape driver connection string looks like "jdbc:cloudscape:[db_name];create=true;autocommit=false"
- pointbase - The Pointbase driver connection string looks like "jdbc:pointbase:server://[hostname]:[port]/[db_name]"
- postgresql - The PostgreSQL driver connection string looks like "jdbc:postgresql://[hostname]:[port]/[db_name]"
- mysqlconj - The MySQL Connector/J driver connection string looks like "jdbc:mysql://[hostname]:[port]/[db_name]"
- mysqlcaucho - The MySQL Cahcho driver connection string looks like "jdbc:mysql-caucho://[hostname]:[port]/[db_name]"
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.
- -user or -u The user name to use to log into the database with.
- -password or -p The password to use to log into the database with. If this option is missing then the program asks for the password.
- -pf Optional file to specify the password. This prevents having to have it visible when looking at a process status. The first line of the file is read and used as the password. If both the command line password and this option are specified the command line password is used.
- -c The "command terminator" to use. By default this application uses the string "go" (case insensitive) on a line by itself to determine when to send the string buffer to the database. You may specify something else with the -c option. For example, users of Oracle may prefer either the ";" (semi-colon) character or the "/" (forwardslash) character as that is what sqlplus uses. This string may occur as a standalone line or at the end of a particular line.
- -w Specifies the maximum field width for a column. By default jisql does not try to make the output look "better". By specifing a value jisql will truncate the output of columns that are wider than this parameter.
- -input The name of a file to read commands from instead of System.in.
- -debug This turns on some internal debugging code. Not generally useful.
- -driverinfo Allows you to print some information that the driver returns. Generally not very useful in all but a few cases.
- -spacer Changes the spacer between columns from a single space to the first character of the argument.
New! - if you're having any issues with jisql, come and discuss it in our forums.
Copyright (C) 2004-2008 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.
2 条评论:
Whats up! I just want to give an enormous thumbs up for the nice info
you’ve got right here on this post. I might
be coming back to your blog for more soon.
Here is my web blog :: carnaval y semana santa 2013 venezuela
Hiya! I simply want to give a huge thumbs up for the nice information you’ve right here on this post.
I will be coming back to your weblog for extra soon.
Feel free to surf to my weblog :: seoul lotte hotel mapo
发表评论