Next Previous Up Contents
Next: Examples
Up: sqlclient: Executes SQL statements
Previous: sqlclient: Executes SQL statements

### B.19.1 Usage

The usage of `sqlclient` is

       stilts <stilts-flags> sqlclient db=<jdbc-url> user=<value> password=<value>
                                       sql=<sql> ofmt=<out-format>

If you don't have the `stilts` script installed, write "`java -jar stilts.jar`" instead of "`stilts`" - see Section 3. The available `<stilts-flags>` are listed in Section 2.1. For programmatic invocation, the Task class for this command is `uk.ac.starlink.ttools.task.SqlClient`.

Parameter values are assigned on the command line as explained in Section 2.3. They are as follows:

`db = <jdbc-url>` (Connection)
  URL which defines a connection to a database. This has the form `jdbc:<subprotocol>:<subname>` - the details are database- and driver-dependent. Consult Sun's JDBC documentation and that for the particular JDBC driver you are using for details. Note that the relevant driver class will need to be on your classpath and referenced in the `jdbc.drivers` system property as well for the connection to be made.
`ofmt = <out-format>` (String)
  Specifies the format in which the output table will be written (one of the ones in Section 5.1.2 - matching is case-insensitive and you can use just the first few letters). If it has the special value "`(auto)`" (the default), then the output filename will be examined to try to guess what sort of file is required usually by looking at the extension. If it's not obvious from the filename what output format is intended, an error will result.

  [Default: `text`]

`password = <value>` (String)
  Password for logging in to SQL database.
`sql = <sql>` (String)
  Text of an SQL statement for execution. This parameter may be repeated, or statements may be separated by semicolon ("`;`") characters.
`user = <value>` (String)
  User name for logging in to SQL database. Defaults to the current username.

  [Default: `mbt`]

Next Previous Up Contents
Next: Examples
Up: sqlclient: Executes SQL statements
Previous: sqlclient: Executes SQL statements

STILTS - Starlink Tables Infrastructure Library Tool Set
Starlink User Note256
STILTS web page: http://www.starlink.ac.uk/stilts/
Author email: m.b.taylor@bristol.ac.uk
Mailing list: topcat-user@jiscmail.ac.uk