Accessing Db2 Big SQL from the JSqsh client

You can use Db2 Big SQL from any client tool that uses a JDBC or ODBC driver. One of those clients is the Java™ SQL shell (JSqsh).

Procedure

To connect your JSqsh client to the Db2 Big SQL server, complete the following steps on the JSqsh client node:

  1. Navigate to the JSqsh bin directory:
    cd /usr/ibmpacks/common-utils/current/jsqsh/bin
  2. Run the setup command:
    ./jsqsh --setup
    1. Type D to launch the Driver wizard.
    2. Type 1 to select the DB2® driver.
    3. Type 4to select the URL. Specify the database name (BIGSQL), port (32051), and DB2 server (Db2 Big SQL head node, example.server.name.com).
    4. Type S to save and then B to go back.
    5. Type C for the connection wizard.
    6. Type 1 to select the DB2 driver.
    7. Type 4 for user (set the user to bigsql), 5 for password (set the password to bigsql), and 6 to set Autoconnect to true (automatically connects to Db2 Big SQL and displays the jsqsh prompt without requesting a password).
    8. Type T to test the connection and then S to save. Confirm the changes by typing Y.
    9. Specify a new connection name (for example, bigsql) and save or type Y to confirm.
    10. Type Q to quit.
  3. To connect to the BIGSQL database, run the following command from the jsqsh prompt.
    BIGSQL is the schema name.
    
    use bigsql;
  4. To test your connection, create, populate, and query a sample table. For example:
    
    create table t1 (c1 int, c2 varchar(10));
    insert into t1 values (1, 'sfsdf');
    select * from t1;
    
  5. To verify that the JSqsh client can connect to the DB2 server on port 32051, log in to the Db2 Big SQL head node with su bigsql and run the following commands:
    
    db2
    connect to bigsql
    select * from t1
    
    Verify that the previously inserted record exists.

What to do next

For more information about using the JSqsh interface with Db2 Big SQL see Java SQL Shell (JSqsh).