8 Stew is the database (SQL) tool with JDBC.
10 For details, see "README.md".
15 ### Password Management
17 By defaults, passwords are not encrypted.
18 Setting "Encryption" in the connector will encrypt the password.
20 For details, see [How To Use - Configuration Of "Connector"](#configuration-of-connector).
23 ### Rollback Does Not Work When The Connection Is Disconnecting
25 By defaults, Rollback does not work automatically on disconnect.
26 You have to care that some of DBMSs commit on disconnect.
28 Setting "Auto Rollback" in the connector will rollback automatically on disconnect.
30 For details, see [How To Use - Configuration Of "Connector"](#configuration-of-connector).
35 For more information, see the project site.
36 <http://stew.sourceforge.jp/>
41 Just extract the package archive file.
46 If you want to use GUI mode, execute the following command:
48 > java -jar stew.jar --gui
50 If you want to use CUI mode, execute the following command:
52 > java -jar stew.jar --cui
54 At first time, a system directory ".stew" created. It is used by some configurations.
55 By default, ".stew" creates at the current directory.
60 Remove all of installed files and ".stew" directory.
63 ----------------------------------------------------------------------------------------------------
67 To access database with Stew, you need DBMS that supports JDBC and its JDBC driver.
68 For details, see the manual of DBMS.
71 ### Configuration Of "Connector"
73 In Stew, an asset of JDBC Connection called it "Connector".
75 In CUI mode, to start edit tool, specifies --edit option.
83 In GUI mode, executes "Edit Connectors" to start edit dialog.
86 Connector has the following properties:
89 : ID for connector command. Allows only ASCII letters (A-Za-z0-9).
92 : The name to display at Prompt.
95 : Specifies classpath of JDBC driver. This form is same with -CLASSPATH option.
98 : Specifies the driver class that implements java.sql.Driver.
99 (In GUI mode, you can use the "search Driver" button.)
102 : Specifies JDBC URL (same as url at DriverManager.getConnection(url)).
105 : Specifies the user ID.
108 : Specifies the password of its user ID.
111 : Specifies the type to save password into file.
112 See the next section.
115 : Is set to READONLY the connection, so that you can not run the commands that update.
116 (., Which according to ReadOnly the command side)
119 : If it was set, the transaction will be rollbacked automatically when disconnect.
123 ### About Password Management
125 How to save the password, you can select the encryption process.
128 : Saves as plain text. (default)
131 : You can store your password by using the PBE encryption.
134 ### Anonymous Connector
136 ### Non-interactive Mode
139 ### connect - Connects to database (built-in)
141 > connect <connector-id>
144 This command connects to database with prepared Connector.
146 In interactive mode, connection is kept until disconnect.
147 If already connected, disconnect it first, then connect.
150 ### disconnect - Disconnects from database (built-in)
155 This command disconnects from database.
157 If auto-rollback was available, try to rollback before disconnecting.
160 ### commit - Commits current transaction (built-in)
162 This command commits current transaction.
164 ** caution: Commit cannot cancel. Please use carefully. **
167 ### rollback - Rollbacks current transaction (built-in)
169 This command rollbacks a current transaction.
172 ### -e - Evaluates multiple commands (built-in)
174 > -e <command> -e <command> ...
176 For example, you can execute two export command continuously,
177 or can execute as batch in non-interactive mode.
180 ### -f - Executes file content as command (built-in)
187 ### -s - Executes file content as script (built-in) \<improved feature in version 4.1\>
189 > -s . | <SCRIPT FILE> | <SCRIPT-NAME> <SCRIPT-CODE>
191 1. If the first argument is ".", the Script Context is reset.
192 2. If the first argument is a filename with extension, the script language is identified by the extension, and the file is run as the script language's script.
193 3. Otherwise, the first argument is recognized as the name of a script language, and the rest of arguments are executed as the script language's script.
195 (Only the built-in JavaScript by file is supported in version 4.0.)
197 To use script languages except the built-in script language (JavaScript), it requires each script engine of script languages such as jruby, jython and groovy.
199 The Script Context keeps global scope bindings, and following scripts can reuse the bindings.
200 If you want to reset Script Context, input " -s . " above.
203 The following variables will be available in the script (global scope):
205 * the reference of current connection: connection, conn
206 * the reference of Parameter: parameter, p
207 * the reference of OutputProcessor: outputProcessor, op
210 ### cd - Changes current directory (built-in)
214 Changes current directory to specified one.
215 (This current directory is not OS's, but internal Stew.)
218 ### @ - Displays directories (built-in)
222 Displays the paths of current directory and system directory.
225 ### ? - Displays System Properties (built-in)
227 > ? [<property-name> [<property-name-2> ... <property-name-n>]]
229 Display System Properties. (System.getProperty)
231 By defauts, it displays JRE, OS and Locale.
237 > ? java.version user.timezone zzz
238 java.version=[1.6.0_##]
239 user.timezone=[Europe/London]
243 ### alias - Registers alias (built-in)
245 > alias [<name> [<command>]]
247 Registers the alias of command.
248 When called with an argument, display the alias and its command.
249 When called without arguments, display all aliases.
251 Before registering or displaying, refreshes cached info in memory.
252 If modified aliases in another process, includes you directly edit the config file,
255 (implementation details:
256 for the infinite loop suppression of circular references,
257 the depth of the expansion up to 100.)
261 > alias search select * from
262 > alias count select count(*) from
264 alias search=[select * from]
266 >> select * from table1
267 (diplays the results of "select * from table1")
271 ### unalias - Removes alias (built-in)
275 If the specified alias does not exist, does nothing.
276 Whether the target exists or not, refreshes cached info in memory.
279 ### exit - Exits application (built-in)
283 This command exits Stew without confirmation.
285 All connections will be disconnected automatically.
286 Rollback will do only the connector set auto-rollback option.
287 For automatic rollback, see [Usage - Configuration Of "Connector"](#configuration-of-connector).
290 ### load - Executes file content as SQL
292 > load [<SQL-file> | <data-file> <table-name> [ HEADER ]]
294 This command executes the SQL read from specified file.
296 When If a parameter is specified, executes file content as SQL,
297 otherwise, two or more parameters, imports the file as data file.
298 The file format is automatically selected by file extension.
301 * .xml : XML format (definition: src/net/argius/stew/io/stew-table.dtd)
302 * otherwise: TSV format
304 (implementation detail: this is basically same as import command,
305 executes as not batch but executes by record)
308 ### import - Imports from file
310 import <data-file> <table-name> [ HEADER ]
312 This command imports from file as data file.
313 The file format is automatically selected by file extension.
316 * .xml : XML format (definition: src/net/argius/stew/io/stew-table.dtd)
317 * otherwise: TSV format
319 (implementation detail: this is basically same as load command,
320 but uses Statement#addBatch.)
323 ### export - Exports to file
325 This command exports result of command to the specified file.
326 The file format is automatically selected by file extension.
328 * .htm,html : HTML format
330 * .xml : XML format (definition: src/net/argius/stew/io/stew-table.dtd)
334 ### time - Measures time to execute SQL
336 > time [<count>] <SQL>
338 This command executes specified SQL and measures its execution time.
340 If specified count, executes SQL by count continuously
341 and summaries "Total", "Ave(average)", "Max" and "Min".
342 Otherwise, executes once and measure its execution time.
344 > time select * from EMPLOYEE
345 execution time: 0.093 seconds
346 > time 100 select * from EMPLOYEE
354 ### find - Finds table names
356 > find <table-name-pattern> [<table-type-pattern> [<schema-pattern> [<catalog-pattern> [ FULL ]]]]
358 This command displays list of tables allowed to show.
359 The parameter including "pattern" in its name can be specified wildcard (#,?).
362 ### report - Reports database info
364 > report - | <table-name> [ FULL | PK | INDEX ]
366 This command displays the info about current connection and connecting database.
368 If specifies - (hyphen), displays the name and version of database and JDBC driver,
369 user and JDBC address.
371 If only specifies table name, displays the column info about specified table.
373 If specifies table name and option,
374 displays the primary key or index info about specified table.
377 ### download - Downloads a column as file
379 > download <root-dir> SELECT <data-column> [, file-path...] FROM ...
381 This command downloads a column data by rows and saves to file.
384 It is useful for downloading large text data or large objects (BLOB, CLOB) all at once.
386 In order to be able to download multiple files,
387 generates file name using column data.
389 The file name will be generated by concatenate second column and after as string.
390 This supporses to specify primary keys and file extension.
392 > download emp select FULL_NAME, JOB_COUNTRY, '/', EMP_NO, '.txt' from EMPLOYEE
393 The dir[./emp/USA] was created.
394 Downloaded. (size=14bytes, file=./emp/USA/2.txt)
395 Downloaded. (size=12bytes, file=./emp/USA/4.txt)
399 Downloaded. (size=12bytes, file=./emp/USA/24.txt)
400 The dir[./emp/England] was created.
401 Downloaded. (size=11bytes, file=./emp/England/28.txt)
405 Downloaded. (size=18bytes, file=./emp/USA/145.txt)
408 When data exist a record, specified <data-column>,
409 saves file to <root-dir> as file name.
411 Saving file already exists or no permission to write file,
412 the process will abort immediately.
415 ### upload - Uploads file data to a column
417 > upload <file> <SQL(UPDATE|INSERT)>
419 This command registers a data file to the column that specified by place-holder.
422 ### wait - Waits for specified interval
426 This command waits for the interval that specified number (mixed decimal) of seconds.
427 It may be useful for executing multiple commands.
435 Standard commands, "undo", "redo", "cut", "copy", "paste", and "select all", can use in all text components via context menu or shortcut key.
440 A window has "Input/Output Area", "Result Set Table", "Database Info Tree", "Main Menu", "Status Bar" and "Find Pane".
441 By default, the database info tree, the status bar and the find pane" are hidden.
444 ### Input/Output Area
446 The I/O area is similar to CUI interface.
448 ... When cursor is at the end of textarea, executes command which is string from prompt to the end of textarea.
449 ... Otherwise, move cursor to the end of textarea.
450 ... The part before prompt can't edit.
453 ... Context menus for this component has the standard commands.
458 The result set table displays command results, usually query results from database.
460 The row header (the leftmost of the table) displays the row number.
461 ... display "+" sign instead of the row number in the row header.
463 Automatic column width adjustment ...
466 The context menu for this component are listed below:
470 : This command sorts clicked column, not a selected one.
471 The same column is sorted continuously, ... reverse.
474 : This command copies selected cell values as text into the clipboard.
476 Copy With Escape (Ctrl+Shift-C)
477 : This command copies selected cell values as quoted strings into the clipboard.
480 : This command pastes values into selected cells from the clipboard.
481 Type conversion from the text to column types of the cells depends on each JDBC driver implementation.
484 : This command selects all cells in the table.
486 Clear Selected Cell Value
487 : This command clears selected cell values (actually sets NULL).
489 Set Current Time Value
490 : This command sets current time (Timestamp) into selected cells.
493 : This command copies the table header as text into the clipboard.
496 : This command shows the find pane and sets find target ...
499 : This command adds a new empty row into the table.
501 Insert From Clipboard
502 : This command ... imports data from the clipboard and inserts the data into the linking table.
505 : This command adds duplicate rows ... selected cells.
507 Link Rows Into Database
508 : This command make unlink ...
511 : This command deletes selected rows.
512 The deleted rows are also deleted from database.
516 ### Database Info Tree
518 The database info tree is a tree view of hierarchical structure, which consists
519 catalogs, schemas, tables, table type and columns as a tree.
520 Not connected: blank ...
521 just connected: connector as a root node and sub nodes ...
522 Each node expands ...
525 An "Auto-expansion" is a function to automatically expands nodes in the database info tree when connecting a database.
526 If you use it, create a TSV file named "autoexpansion.tsv" in the system directory (.stew) and write node name lists as TSV into this file.
529 The context menu for this component are listed below:
533 : This command copies displayed strings of selected nodes as text into the clipboard.
536 : This command copies the simple name of selected nodes as text into the clipboard.
539 : This command copies the full qualified name of selected nodes as text into the clipboard.
544 Generate WHERE Phrase
545 : This command generates a WHERE phrase consisting selected tables and columns ...
546 selected same name, generate ...
548 Generate SELECT Statement (with WHERE)
549 : This command generates a SELECT statement with "WHERE" keyword.
551 Generate UPDATE Statement (with WHERE)
554 Generate INSERT Statement
557 Jump To Column By Name
558 : This command ... the name of selected node. Jump to the column which has the same name in current result table if found it.
559 Double-clicking the node is the same as this command.
561 Toggle Show Column Number
562 : This command provides the toggle between showing and hiding the column number of all columns nodes.
572 ... Display last command and its execution time.
573 ...This time is not query but command.
576 ### Saving Configuration
584 It is not able to change key bind after opening new window.
585 ... For the keywords, see https://github.com/argius/Stew4/blob/master/src/net/argius/stew/ui/window/Menu.u8p
588 ## Menus in the GUI Mode
590 ### File - New Window (N) Ctrl-N
592 This command opens a new window.
593 Current connections are independent of each window.
596 ### File - Close Window (C) Ctrl-W
598 This command closes current window.
599 If connected, show confirm dialog.
601 If current window is only a window, processes as Quit(Q).
604 ### File - Quit (Q) Ctrl-Q
606 This command quits this application.
607 When executed, shows confirm dialog. Click "Yes" to quit.
610 ### Edit - Cut (T) Ctrl-X
612 This command cuts the selection to the clipboard.
615 ### Edit - Copy (C) Ctrl-C
617 This command copies the selection to the clipboard.
620 ### Edit - Paste (P) Ctrl-V
622 This command pastes the selection to the clipboard.
625 ### Edit - Select All (A) Ctrl-A
627 This command selects all text or all elements.
630 ### Edit - Find (F) Ctrl-F
632 This command finds out a specific string from selected component.
637 ### Edit - Toggle focus (G) Ctrl-G
639 This command toggles focus between the result set table and the input/output area in a current window.
641 ### Edit - Clear Message (M)
643 This command clears input/output area in a current window.
646 ### View - Show Status Bar (S)
648 This command toggles the visibility of status bar in a current window.
651 ### View - Show Column Number (C)
653 This command toggles the visibility of column number in the result set table of a current window.
656 ### View - Show Info Tree (I)
658 This command toggles the visibility of database info tree in a current window.
661 ### View - Always On Top (T)
663 This command toggles the state that always stays on top of a current window.
666 ### View - Refresh (R) F5
671 ### View - Widen Column Width (W) Ctrl-.(period)
673 This command widens all column widths in the result set table of a current window.
676 ### View - Narrow Column Width (N) Ctrl-,(comma)
678 This command narrows all column widths in the result set table of a current window.
681 ### View - Adjust Column Width (A) Ctrl-/(slash)
683 This command adjusts all column widths in the result set table of a current window.
684 For about adjust mode, see the next item.
687 ### View - Auto Adjust Mode (M)
689 This command selects auto-adjusting mode to use when shows result.
691 There are following modes:
693 * None(N): does nothing.
694 * Header(H): adjusts column width based on each header string.
695 * Value(V): adjusts based on the longest string in column values.
696 * Header And Value(A): adjusts based on the longest string in column values and column header string.
699 ### Command - Execute (X) Ctrl-M
701 This command executes command.
702 This is same as pressing enter key in the end of the I/O area. (... same behavior)
705 ### Command - BREAK (B) Ctrl-Pause(Break)
707 This command cancels executing command.
708 The process on the server is not canceled.
711 ### Command - History Back (P) Ctrl-Up
713 This command rotates command histories backward.
716 ### Command - History Next (N) Ctrl-Down
718 This command rotates command histories forward.
721 ### Command - Rollback (R)
723 This command displays confirm dialog and click "OK" to rollback.
726 ### Command - Commit (M)
728 This command displays confirm dialog and click "OK" to commit.
731 ### Command - Connect (C) Ctrl-E
733 This command shows the list of connectors.
734 Select connector name you want to connect to, and click "OK" to executes connect command.
737 ### Command - Disconnect (D) Ctrl-D
739 This command disconnects current connection.
740 This is the same as disconnect command.
743 ### Command - Post-Proccess (0)
745 This command specifies the configuration of a "Post-Proccess" mode.
747 The "Post-Proccess" is an action to notify that command finished.
748 When the window which command is running, is not active, "Post-Proccess" is invoked.
750 There are following modes:
752 * None(N): Does nothing.
753 * Focus(F): Focuses window.
754 * Shake(S): Shakes window.
755 * Blink(B): Blinks window.
758 ### Command - Encryption Key (K)
760 This command shows the dialog to input an encryption key.
763 ### Command - Edit Connectors (E)
765 This command shows the dialog to edit connectors.
768 ### Data - Sort (S) Alt-S
770 This command sorts records by selected column.
773 ### Data - Import File (I)
775 This command imports from file into the table of current result.
778 ### Data - Export File (E) Ctrl-Shift-S
780 This command exports results into file.
785 This command shows this help file by default browser.
788 ### Help - About Stew
790 This command shows version dialog about Stew.
796 You can set these system properties into java -D option or stew.properties file.
799 ### net.argius.stew.properties - Location Of Properties File
801 Property Value: a file path or a directory path
803 This property specifies the location of "stew.properties" file.
804 This properties file is used as system properties and searched in the following steps:
806 +If it specifies a file path, the file will be used as system properties.
807 +If it specifies a directory path, the file will be searched a "stew.properties" file in the directory.
808 +Search a file in the classpath.
809 +Search a file in the system directory.
811 The first file found is used.
812 If a file is not found, ... (ignore it).
815 ### net.argius.stew.directory - Working Directory
817 Property Value: a directory path (default: current directory)
819 This property specifies the current directory as a internal state at the start, but it is not a platform one.
822 ### net.argius.stew.query.timeout - Query Timeout
824 Property Value: integer seconds (default: 0)
826 This property specifies the query timeout which is used in commands.
828 If it is under 0, the property was not set.
830 (implementation detail: for java.sql.Statement#setQueryTimeout)
833 ### net.argius.stew.rowcount.limit - Limit Of Display Result Row Count
835 Property Value: maximum number of rows (default: Integer.MAX_VALUE, about 2,147,000,000)
837 This property specifies the maximum number of rows which show in the result set table.
838 It is not used to output files, such as the export command.
841 ### net.argius.stew.command.Import.batch.limit - Limit Of Import Command Using Batch
843 Property Value: limit number of rows (default: 10000)
845 This property is used by the Import command.
846 It is not used to output files, such as the export command.
849 ### net.argius.stew.ui.window.resident - Regident
851 Property Value: integer minutes
853 This is an experimental feature.
855 The app redraws continuously at the specified interval to prevent swap-out.
858 ### Logger Configurations
860 Use logging.properties in this package.