Using sqlLineRemote to Connect to a Database

<< Click to Display Table of Contents >>

Navigation:  Using sqlline >

Using sqlLineRemote to Connect to a Database

Previous pageReturn to chapter overviewNext page

SQLstream includes several scripts for command-line communication with the SQLstream s-Server. See the topic SQLLine in the s-Server Getting Started Guide for more details.

These scripts enable the sqlline command-line SQL interpreter to run as a client to an any database server that supports JDBC. In other words, SQLlineRemote enables command-line connection to a relational database to execute SQL commands. (The sqllineRemote script can be found in $SQLSTREAM_HOME/bin.)

SqllineRemote uses Aspen runtime Jars for access to drivers. You can pass one or more connection-properties files to connect to the remote server(s):

   ./sqllineRemote file1 file2 ...

 

As a convenience, connection-properties file names of the form

   myserver.conn.properties

 

can be referenced as simply "myserver":

   ./sqllineRemote myserver

 

sqllineRemote must execute in the directory that it was started to allow !run to find a file in that directory, such as files like myserver.conn.properties.

Create a <database>.conn.properties file with the following entries (supply your own password):

url=jdbc:<database>://myhostname

driver=org.<database>.Driver

user=<database>

password=

 

To connect to a particular database, append it to the URL, e.g., jdbc:<database>://myhostname/farrago). Then run

   ./sqllineRemote <database>

 

Test it by using sqllineRemote for table access.

  1. !tables

  2. Select * from sales.emps

  3. Insert a row into sales.emps

 

or whatever tables you know are there