title
SQLMini
SQLMini is a simple SQL client that allows to examine data in SQL database.
I needed a simple tool, that would allow me to have a look into the database.
I wanted it to work on Linux and Windows and wanted it to work well over
slow network connection to the database.
- remember connection settings for multiple databases including name and password
- configurable color syntax highlight in the editor
- configurable color syntax highlight of matching parenthesis
- semi-automatic completion of table and column names
- running multiple queries concurrently
- manual interrupting of a running query
- sorting the result of query based on selected column in ascending or descending order
- show type of column in the tooltip of result grid
- show name of column in the tooltip
- reading database structure in background
- reading blob values
- save result in to .csv file
- copy the selected cell or row into clipboard
- saving the text of query into a file
- reading the text of query from file
- offer last 10 recently saved files
- specifying the database driver from command-line
- show SQL table definition
- allow expanding the list of recognized keywords and built-in functions for syntax highlight
- show the log in standalone window instead of standard output
- intelligent sizing of column widths
The application is written in Java. In the upper part of the window is combobox
where you have to write the URL for connecting to the database in the form
requested by JDBC. For oracle running on port 1521 it is:
jdbc:oracle:thin:@servername:1521:databasename
For MySQL it is:
jdbc:mysql://servername/databasename
For Postgress running on port 5432 it is:
jdbc:postgresql://servername:5432/databasename
For SQLite it is:
SQLMini.jar:jdbc:sqlite:databasename
Basics
After filling the URL field, the login name and password you an press the button
Connect
. The program attempts to create a connection to the database
If it succeeds, it will read from the database the list of known tables.
That can take a few seconds. When you start writing query,
I recommend writing first few characters of table name and let it automatically fill
in the rest by pressing Ctrl+<space>
. That will launch background
reading of columns of this table in order to make them available for autmatic completion.
That can again take a few seconds.
The completion of the column names works again using combination Ctrl+<space>
.
If the typed prefix can be prefix of both column name and table name, both are offered - columns first.
After the query is written, press the button Execute
. The query will be sent
to the server and after obtaining the answer, it will be shown in the grid in bottom
part of the window.
Advanced usage
Multiple queries can be separated by semicolon.
- Context menu in the area for writing the query is offering actions for reading
and saving query to file, for changing the font and also for configuration of colors
used for syntax highlight.
- Context menu in the area for showing the query results offers actions for copying
the selected cell or row into the clipboard and setting the font. If you clicked
into column of type BLOB, the menu will also have an item for saving the selected
cell into a file
- Clicking on the header of grid with results, you can sort the table on that column
Repeated click reverses the sorting order.
- Clicking on with the right mouse button on the combobox with database URL
you get an option to remove the selected item from the list.
- DDL statements (update, create table, delete, ... )
- allow creating custom list of your own SQL functions/stored procedures recognized
for syntax highlight
- show count of rows in the resultset
- handle multiline comments in syntax highlight
- handle table and column aliases
- GUI localization
- The program does note recognize some SQL keywords (see)
- highlighting of matching parenthesis does not work if it is on different line as cursor
- The passwords are saved unencrypted
Download
SQLMini-0.8.1.jar or start it
Due to licensing reasons, this contains only MySQL (GPL licensed)
and Postgress (BSD licensed) driver.
If you use different database, you should get the JDBC driver from
your DB's vendor.
For example Oracle offers JDBC drivers
here
If you need to connect to something other than MySQL or Progress, you need to add the driver .jar
file to java classpath (i.e. list it after -cp
parameter) and give the name of the driver class
after -D
parameter. Note, that on Windows the classpath separator is semicolon (;), while
in the Unix world it is colon (:).
The command line for using ojdbc14_g.jar driver for Oracle may look like this:
java -cp ojdbc14_g.jar:SQLMini.jar org.rastos.SQLMini.Main -D oracle.jdbc.driver.OracleDriver
An installation package for Windows with bundled Oracle JDBC driver can be found
here. Note that the Oracle JDBC driver
has a separate
license
Source code
SQLMini-0.7.18.src.tar.bz2