13 ### Password Management
18 For details, see [How To Use - Connector Settings](#Connector-Settings).
21 ### Rollback Does Not Work When The Connection Is Disconnecting
27 For details, see [How To Use - Connector Settings](#Connector-Settings).
32 For more information, see the project site.
33 <http://stew.sourceforge.jp/>
45 If you want to use GUI mode, execute the following command:
47 > java -jar stew.jar --gui
49 If you want to use CUI mode, execute the following command:
51 > java -jar stew.jar --cui
53 At first time, a system directory ".stew" created. It is used by some configurations.
54 By default, ".stew" creates at the current directory.
59 Remove all of installed files and ".stew" directory.
62 ----------------------------------------------------------------------------------------------------
66 To access database with Stew, you need DBMS that supports JDBC and its JDBC driver.
67 For details, see the manual of DBMS.
70 ### Configuration Of "Connector"
72 In Stew, an asset of JDBC Connection called it "Connector".
74 In CUI mode, to start edit tool, specifies --edit option.
81 In GUI mode, executes "Edit Connectors" to start edit dialog.
84 Connector has the following properties:
87 : ID for connector command. Allows only ASCII letters (A-Za-z0-9).
90 : The name to display at Prompt.
93 : Specifies classpath of JDBC driver. This form is same with -CLASSPATH option.
96 : Specifies the driver class that implements java.sql.Driver.
97 (In GUI mode, you can use the "search Driver" button.)
100 : Specifies JDBC URL (same as url at DriverManager.getConnection(url)).
103 : Specifies the user ID.
106 : Specifies the password of its user ID.
109 : Specifies the type to save password into file.
110 See the next section.
113 : Is set to READONLY the connection, so that you can not run the commands that update.
114 (., Which according to ReadOnly the command side)
117 : If it was set, the transaction will be rollbacked automatically when disconnect.
121 ### About Password Management
123 How to save the password, you can select the encryption process.
126 : Saves as plain text. (default)
129 : You can store your password by using the PBE encryption.
132 ### Anonymous Connector
134 ### Non-interactive Mode
137 ### connect - Connects to database (built-in)
139 > connect <connector-id>
142 This command connects to database with prepared Connector.
144 In interactive mode, connection is kept until disconnect.
145 If already connected, disconnect it first, then connect.
148 ### disconnect - Disconnects from database (built-in)
153 This command disconnects from database.
155 If auto-rollback was available, try to rollback before disconnecting.
158 ### commit - Commits current transaction (built-in)
160 This command commits current transaction.
162 ** caution: Commit cannot cancel. Please use carefully. **
165 ### rollback - Rollbacks current transaction (built-in)
167 This command rollbacks a current transaction.
170 ### -e - Evaluates multiple commands (built-in)
172 > -e <command> -e <command> ...
174 For example, you can execute two export command continuously,
175 or can execute as batch in non-interactive mode.
178 ### -f - Executes file content as command (built-in)
185 ### -s - Executes file content as script (built-in)
189 ( default=JavaScript )
191 The following variables will be available in the script:
193 * object of current connection: connection, conn
194 * object of Parameter: parameter, p
195 * object of OutputProcessor: outputProcessor, op
198 ### cd - Changes current directory (built-in)
202 Changes current directory to specified one.
203 (This current directory is not OS's, but internal Stew.)
206 ### @ - Displays directories (built-in)
210 Displays the paths of current directory and system directory.
213 ### ? - Displays System Properties (built-in)
215 > ? [<property-name> [<property-name-2> ... <property-name-n>]]
217 Display System Properties. (System.getProperty)
219 By defauts, it displays JRE, OS and Locale.
225 > ? java.version user.timezone zzz
226 java.version=[1.6.0_##]
\r
227 user.timezone=[Europe/London]
\r
231 ### alias - Registers alias (built-in)
233 > alias [<name> [<command>]]
235 Registers the alias of command.
236 When called with an argument, display the alias and its command.
237 When called without arguments, display all aliases.
239 Before registering or displaying, refreshes cached info in memory.
240 If modified aliases in another process, includes you directly edit the config file,
243 (implementation details:
244 for the infinite loop suppression of circular references,
245 the depth of the expansion up to 100.)
249 > alias search select * from
250 > alias count select count(*) from
252 alias search=[select * from]
254 >> select * from table1
255 (diplays the results of "select * from table1")
259 ### unalias - Removes alias (built-in)
263 If the specified alias does not exist, does nothing.
264 Whether the target exists or not, refreshes cached info in memory.
267 ### exit - Exits application (built-in)
271 This command exits Stew without confirmation.
273 All connections will be disconnected automatically.
274 Rollback will do only the connector set auto-rollback option.
275 For automatic rollback, see [Usage - Configuration Of "Connector"](#configuration-of-connector).
278 ### load - Executes file content as SQL
280 > load [<SQL-file> | <data-file> <table-name> [ HEADER ]]
282 This command executes the SQL read from specified file.
284 When If a parameter is specified, executes file content as SQL,
285 otherwise, two or more parameters, imports the file as data file.
286 The file format is automatically selected by file extension.
288 *. .xml : XML format (definition: src/net/argius/stew/io/stew-table.dtd)
289 *. otherwise: TSV format
291 (implementation detail: this is basically same as import command,
292 executes as not batch but executes by record)
295 ### import - Imports from file
297 import <data-file> <table-name> [ HEADER ]
299 This command imports from file as data file.
300 The file format is automatically selected by file extension.
302 *. .xml : XML format (definition: src/net/argius/stew/io/stew-table.dtd)
303 *. otherwise: TSV format
305 (implementation detail: this is basically same as load command,
306 but uses Statement#addBatch.)
309 ### export - Exports to file
311 This command exports result of command to the specified file.
312 The file format is automatically selected by file extension.
313 *. .htm,html : HTML format
315 *. .xml : XML format (definition: src/net/argius/stew/io/stew-table.dtd)
316 *. others: TSV format
319 ### time - Measures time to execute SQL
321 > time [<count>] <SQL>
323 This command executes specified SQL and measures its execution time.
325 If specified count, executes SQL by count continuously
326 and summaries "Total", "Ave(average)", "Max" and "Min".
327 Otherwise, executes once and measure its execution time.
329 > time select * from EMPLOYEE
330 execution time: 0.093 seconds
331 > time 100 select * from EMPLOYEE
339 ### find - Finds table names
341 > find <table-name-pattern> [<table-type-pattern> [<schema-pattern> [<catalog-pattern> [ FULL ]]]]
343 This command displays list of tables allowed to show.
344 The parameter including "pattern" in its name can be specified wildcard (#,?).
347 ### report - Reports database info
349 > report - | <table-name> [ FULL | PK | INDEX ]
351 This command displays the info about current connection and connecting database.
353 If specifies - (hyphen), displays the name and version of database and JDBC driver,
354 user and JDBC address.
356 If only specifies table name, displays the column info about specified table.
358 If specifies table name and option,
359 displays the primary key or index info about specified table.
362 ### download - Downloads a column as file
364 > download <root-dir> SELECT <data-column> [, file-path...] FROM ...
366 This command downloads a column data by rows and saves to file.
369 It is useful for downloading large text data or large objects (BLOB, CLOB) all at once.
371 In order to be able to download multiple files,
372 generates file name using column data.
374 The file name will be generated by concatenate second column and after as string.
375 This supporses to specify primary keys and file extension.
377 > download emp select FULL_NAME, JOB_COUNTRY, '/', EMP_NO, '.txt' from EMPLOYEE
378 The dir[./emp/USA] was created.
379 Downloaded. (size=14bytes, file=./emp/USA/2.txt)
380 Downloaded. (size=12bytes, file=./emp/USA/4.txt)
384 Downloaded. (size=12bytes, file=./emp/USA/24.txt)
385 The dir[./emp/England] was created.
386 Downloaded. (size=11bytes, file=./emp/England/28.txt)
390 Downloaded. (size=18bytes, file=./emp/USA/145.txt)
393 When data exist a record, specified <data-column>,
394 saves file to <root-dir> as file name.
396 Saving file already exists or no permission to write file,
397 the process will abort immediately.
400 ### upload - Uploads file data to a column
402 > upload <file> <SQL(UPDATE|INSERT)>
404 This command registers a data file to the column that specified by place-holder.
407 ### wait - Waits for specified interval
411 This command waits for the interval that specified number of seconds.
412 It may be useful for executing multiple commands.
420 Standard commands, "undo", "redo", "cut", "copy", "paste", and "select all", can use in all text components via context menu or shortcut key.
425 A window has "Input/Output Area", "Result Set Table", "Database Info Tree", "Main Menu", "Status Bar" and "Find Pane".
426 By default, the database info tree, the status bar and the find pane" are hidden.
429 ### Input/Output Area
431 The I/O area is similar to CUI interface.
433 ... When cursor is at the end of textarea, executes command which is string from prompt to the end of textarea.
434 ... Otherwise, move cursor to the end of textarea.
435 ... The part before prompt can't edit.
438 ... Context menus for this component has the standard commands.
443 The result set table displays command results, usually query results from database.
445 The row header (the leftmost of the table) displays the row number.
446 ... display "+" sign instead of the row number in the row header.
448 Automatic column width adjustment ...
451 The context menu for this component are listed below:
455 : This command sorts clicked column, not a selected one.
456 The same column is sorted continuously, ... reverse.
459 : This command copies selected cell values as text into the clipboard.
461 Copy With Escape (Ctrl+Shift-C)
462 : This command copies selected cell values as quoted strings into the clipboard.
465 : This command pastes values into selected cells from the clipboard.
466 Type conversion from the text to column types of the cells depends on each JDBC driver implementation.
469 : This command selects all cells in the table.
471 Clear Selected Cell Value
472 : This command clears selected cell values (actually sets NULL).
474 Set Current Time Value
475 : This command sets current time (Timestamp) into selected cells.
478 : This command copies the table header as text into the clipboard.
481 : This command shows the find pane and sets find target ...
484 : This command adds a new empty row into the table.
486 Insert From Clipboard
487 : This command ... imports data from the clipboard and inserts the data into the linking table.
490 : This command adds duplicate rows ... selected cells.
492 Link Rows Into Database
493 : This command make unlink ...
496 : This command deletes selected rows.
497 The deleted rows are also deleted from database.
501 ### Database Info Tree
503 The database info tree is a tree view of hierarchical structure, which consists
504 catalogs, schemas, tables, table type and columns as a tree.
505 Not connected: blank ...
506 just connected: connector as a root node and sub nodes ...
507 Each node expands ...
510 An "Auto-expansion" is a function to automatically expands nodes in the database info tree when connecting a database.
\r
511 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.
514 The context menu for this component are listed below:
518 : This command copies displayed strings of selected nodes as text into the clipboard.
521 : This command copies the simple name of selected nodes as text into the clipboard.
524 : This command copies the full qualified name of selected nodes as text into the clipboard.
529 Generate WHERE Phrase
530 : This command generates a WHERE phrase consisting selected tables and columns ...
531 selected same name, generate ...
533 Generate SELECT Statement (with WHERE)
534 : This command generates a SELECT statement with "WHERE" keyword.
536 Generate UPDATE Statement (with WHERE)
539 Generate INSERT Statement
542 Jump To Column By Name
543 : This command ... the name of selected node. Jump to the column which has the same name in current result table if found it.
544 Double-clicking the node is the same as this command.
546 Toggle Show Column Number
547 : This command provides the toggle between showing and hiding the column number of all columns nodes.
557 ... Display last command and its execution time.
558 ...This time is not query but command.
561 ### Saving Configuration
569 It is not able to change key bind after opening new window.
570 ... For the keywords, see https://github.com/argius/Stew4/blob/master/src/net/argius/stew/ui/window/Menu.u8p
573 ## Menus in the GUI Mode
575 ### File - New Window (N) Ctrl-N
577 This command opens a new window.
578 Current connections are independent of each window.
581 ### File - Close Window (C) Ctrl-W
583 This command closes current window.
584 If connected, show confirm dialog.
586 If current window is only a window, processes as Quit(Q).
589 ### File - Quit (Q) Ctrl-Q
591 This command quits this application.
592 When executed, shows confirm dialog. Click "Yes" to quit.
595 ### Edit - Cut (T) Ctrl-X
597 This command cuts the selection to the clipboard.
600 ### Edit - Copy (C) Ctrl-C
602 This command copies the selection to the clipboard.
605 ### Edit - Paste (P) Ctrl-V
607 This command pastes the selection to the clipboard.
610 ### Edit - Select All (A) Ctrl-A
612 This command selects all text or all elements.
615 ### Edit - Find (F) Ctrl-F
617 This command finds out a specific string from selected component.
622 ### Edit - Toggle focus (G) Ctrl-G
624 This command toggles focus between the result set table and the input/output area in a current window.
626 ### Edit - Clear Message (M)
628 This command clears input/output area in a current window.
631 ### View - Show Status Bar (S)
633 This command toggles the visibility of status bar in a current window.
636 ### View - Show Column Number (C)
638 This command toggles the visibility of column number in the result set table of a current window.
641 ### View - Show Info Tree (I)
643 This command toggles the visibility of database info tree in a current window.
646 ### View - Always On Top (T)
648 This command toggles the state that always stays on top of a current window.
651 ### View - Refresh (R) F5
656 ### View - Widen Column Width (W) Ctrl-.(period)
658 This command widens all column widths in the result set table of a current window.
661 ### View - Narrow Column Width (N) Ctrl-,(comma)
663 This command narrows all column widths in the result set table of a current window.
666 ### View - Adjust Column Width (A) Ctrl-/(slash)
668 This command adjusts all column widths in the result set table of a current window.
669 For about adjust mode, see the next item.
672 ### View - Auto Adjust Mode (M)
674 This command selects auto-adjusting mode to use when shows result.
676 There are following modes:
678 * None(N): does nothing.
679 * Header(H): adjusts column width based on each header string.
680 * Value(V): adjusts based on the longest string in column values.
681 * Header And Value(A): adjusts based on the longest string in column values and column header string.
684 ### Command - Execute (X) Ctrl-M
686 This command executes command.
687 This is same as pressing enter key in the end of the I/O area. (... same behavior)
690 ### Command - BREAK (B) Ctrl-Pause(Break)
692 This command cancels executing command.
693 The process on the server is not canceled.
696 ### Command - History Back (P) Ctrl-Up
698 This command rotates command histories backward.
701 ### Command - History Next (N) Ctrl-Down
703 This command rotates command histories forward.
706 ### Command - Rollback (R)
708 This command displays confirm dialog and click "OK" to rollback.
711 ### Command - Commit (M)
713 This command displays confirm dialog and click "OK" to commit.
716 ### Command - Connect (C) Ctrl-E
718 This command shows the list of connectors.
719 Select connector name you want to connect to, and click "OK" to executes connect command.
722 ### Command - Disconnect (D) Ctrl-D
724 This command disconnects current connection.
725 This is the same as disconnect command.
728 ### Command - Post-Proccess (0)
730 This command specifies the configuration of a "Post-Proccess" mode.
732 The "Post-Proccess" is an action to notify that command finished.
733 When the window which command is running, is not active, "Post-Proccess" is invoked.
735 There are following modes:
737 * None(N): Does nothing.
738 * Focus(F): Focuses window.
739 * Shake(S): Shakes window.
740 * Blink(B): Blinks window.
743 ### Command - Encryption Key (K)
745 This command shows the dialog to input an encryption key.
748 ### Command - Edit Connectors (E)
750 This command shows the dialog to edit connectors.
753 ### Data - Sort (S) Alt-S
755 This command sorts records by selected column.
758 ### Data - Import File (I)
760 This command imports from file into the table of current result.
763 ### Data - Export File (E) Ctrl-Shift-S
765 This command exports results into file.
770 This command shows this help file by default browser.
773 ### Help - About Stew
775 This command shows version dialog about Stew.
781 You can set these system properties into java -D option or stew.properties file.
784 ### net.argius.stew.properties - Location Of Properties File
786 Property Value: a file path or a directory path
788 This property specifies the location of "stew.properties" file.
789 This properties file is used as system properties and searched in the following steps:
791 +If it specifies a file path, the file will be used as system properties.
792 +If it specifies a directory path, the file will be searched a "stew.properties" file in the directory.
793 +Search a file in the classpath.
794 +Search a file in the system directory.
796 The first file found is used.
797 If a file is not found, ... (ignore it).
800 ### net.argius.stew.directory - Working Directory
802 Property Value: a directory path (default: current directory)
804 This property specifies the current directory as a internal state at the start, but it is not a platform one.
807 ### net.argius.stew.query.timeout - Query Timeout
809 Property Value: integer seconds (default: 0)
811 This property specifies the query timeout which is used in commands.
813 If it is under 0, the property was not set.
815 (implementation detail: for java.sql.Statement#setQueryTimeout)
818 ### net.argius.stew.rowcount.limit - Limit Of Display Result Row Count
820 Property Value: maximum number of rows (default: Integer.MAX_VALUE, about 2,147,000,000)
822 This property specifies the maximum number of rows which show in the result set table.
823 It is not used to output files, such as the export command.
826 ### net.argius.stew.command.Import.batch.limit - Limit Of Import Command Using Batch
828 Property Value: limit number of rows (default: 10000)
830 This property is used by the Import command.
831 It is not used to output files, such as the export command.
834 ### net.argius.stew.ui.window.resident - Regident
836 Property Value: integer minutes
838 This is an experimental feature.
840 The app redraws continuously at the specified interval to prevent swap-out.
843 ### Logger Configurations
845 Use logging.properties in this package.