Connecting to the database with the command-line client
The command-line client is a SQL tool that is distributed with the Derby database.
Procedure
The nci_db command-line utility wraps
three Derby database utilities:
- Interactive SQL Client connect: You can use the utility to run SQL statements against the database in real time.
- The DDL (Data Definition Language) Generation Utility dblook: You can use the utility to generate DDL output from the database.
- The Derby System information Utility sysinfo: Provides Derby system information.
Examples:
Interactive SQL
connect
example
1:$IMPACT_HOME/bin/nci_db connect
Interactive
SQL
connect
example 2:$IMPACT_HOME/bin/nci_db connect -sqlfile <Path to the SQL file>
The
DDL Generation Utility
dblook
example:$IMPACT_HOME/bin/nci_db dblook -d <URL to the Database> [OPTIONS]
The
Derby System information Utility sysinfo
example:
$IMPACT_HOME/bin/ nci_db sysinfo
The following command shows the help message for nci_db:
$IMPACT_HOME/bin/nci_db help
- Syntax Description
- connect
- Connects to Derby Interactive SQL Client
- -sqlfile <filename>
- The SQL source file to be used. If this option is not specified,
then you must specify the URL to connect to the database at the prompt.
For example:
ij > connect ’jdbc:derby://localhost:1527/ImpactDB;user=impact; password=<derby_password>’;
- dblook
- Runs the DDL generation utility.
- -d <url>
- The URL to connect to the database.
For example:
"jdbc:derby://localhost:1527/ImpactDB;user=impact; password=<derby_password>"
sysinfo
- Provides Derby System information.