Java DB

Apache Derby

Derby Tools and Utilities Guide

Derby Getting Started
Derby Reference Manual
Derby Developer's Guide
Derby Performance Tuning
Derby Server and Admin Guide
Derby Tools and Utilities
Derby Tools and Utilities
-Copyright
-License
-About this guide
-What are the Derby tools and utilities?
-Using ij
-ij properties reference
-ij commands and errors reference
-ij commands
-Absolute command
-After Last command
-Async command
-Autocommit command
-Before First command
-Close command
-Commit command
-Connect command
-Describe command
-Disconnect command
-Driver command
-Elapsedtime command
-Execute command
-Exit command
-First command
-Get Cursor command
-Get Scroll Insensitive Cursor command
-Help command
-Last command
-LocalizedDisplay command
-MaximumDisplayWidth command
-Next command
-Prepare command
-Previous command
-Protocol command
-Readonly command
-Relative command
-Remove command
-Rollback command
-Run command
-Set Connection command
-Show command
-Wait For command
-Syntax for comments in ij commands
-Syntax for identifiers in ij commands
-Syntax for strings in ij commands
-ij errors
-Using the bulk import and export procedures
-Storing jar files in a database
-sysinfo
-dblook
-SignatureChecker
-Trademarks

 

Running ij scripts

You can run scripts in ij in any of the following ways:

  • Name an input file as a command-line argument. For example:
    java org.apache.derby.tools.ij <myscript.sql>
  • Redirect standard input to come from a file. For example:
    java org.apache.derby.tools.ij < <myscript.sql>
  • Use the Run command from the ij command line. For example:
    ij> run 'myscript.sql';
Note: If you name an input file as a command-line argument or if you use the Run command, ij echoes input from a file. If you redirect standard input to come from a file, ij does not echo commands.

You can save output in any of the following ways:

  • By redirecting output to a file:
    java org.apache.derby.tools.ij <myscript.sql> > <myoutput.txt>
    
  • By setting the ij.outfile property:
    java -Dij.outfile=<myoutput.txt> org.apache.derby.tools.ij 
        <myscript.sql>

ij exits when you enter the Exit command or, if executing a script, when the end of the command file is reached. When you use the Exit command, ij automatically shuts down an embedded Derby system by issuing a connect jdbc:derby:;shutdown=true request. It does not shut down Derby if it is running in a server framework.

 

javadb@jdbcurl.com