Command-line Console Documentation

Console is a simple command line interface provided to work with DataCaster Client (DataCore).

Requirements

  • datacore.jar -- The DataCaster Client (DataCore) Classes and any dependent jars.
  • dbutils.jar

Console Invocation

USAGE: console [-u username][-p password] [-d database] 
       [-i inputfile] [-o outputfile] [-l [logfile]] [--config configfile]
       [-f|--format BORDER|CSV] [--noprompt] [--norowprompt] 
       [-v|--verbose] [-h|--help]
  • -u username name of the user
  • -p password user password
  • -d database open the database at start
  • -i inputfile set of command input to console
  • -o outputfile file to use for console message output
  • -l [logfile] log console error messages to logfile (or terminal)
  • --config configfile console configuration file
  • -f | --format BORDER|CSV SQL Query result display format
  • --noprompt Turn off console prompt
  • --norowprompt Turn off prompting while paging output result
  • -v | --verbose Be more verbose in action
  • -h | --help Displays this help message

Commands

All console commands should end with semicolon (;). The commands are not case sensitive.

Sql Support

  • Console supports sql query execution, with only restriction that it should end with semicolon.

Console ConfigFile

  • Console supports input from configuration file. (Use --config option when starting). The following are the list of items that will be used if specified in the file. The command line parameters sent to console will override any value set from the configuration file.

  • INITIALPATH: Prompt name that will be displayed when console is started without -d option, like dcore.

  • VERBOSE: true/false, sets verbosity of console.
  • TABLEFORMAT: BORDER | CSV, result table format display.
  • ROWDISPLAYLIMIT: Number of rows to display at once from the result table (after sql query execution).
  • ROWDISPLAYPROMPT: true/false, whether console should prompt after each page of result table is displayed.
  • LOGFILE: File to use for console error logging.
  • INPUTFILE: File which contains console commands that should be used as input.
  • OUTPUTFILE: File to which console should output the message/result.
  • RMIURL: Default RMI URL that should be used when RMI database will be used.

  • USERNAME: Name of the user who uses console.
  • PASSWORD: User Password.

  • PRIMARYPROMPT: The first part of the prompt, like [ in the prompt [dcore]$
  • SECONDARYPROMPT: The console prompt displayed when the statement is not complete, like ...
  • PROMPTSYMBOL: The last part of the prompt, like ]$ in the prompt [dcore]$
  • NOPROMPT: true/false, prompt dispaly control.

Some Examples

Starting the console

$ console.sh
Please login
Username: testuser
Password: ******
dcore>

Starting the console with command line parameters.

$ console.sh -u username -p password
dcore>

Starting the console with existing database.

$ console.sh -u username -p password -d mydb
mydb>

Console Input from a file

input.txt
use mydb;
select * from sometable;

config.file
USERNAME=testuser
PASSWORD=testpwd
NOPROMPT=true

$ console.sh -i input.txt --config config.file;

Console Output to a file

$ console.sh -i input.txt -o output.txt --noprompt --norowprompt;