Product Documentation

FairCom JDBC

Previous Topic

Next Topic

Command-Line Compile - Linux

This section explains the steps to compile and run the JDBC SQL tutorials from a Linux shell.

If the FairCom Database Engine is not already running on your machine, start the server. See Starting the FairCom Database Engine.

Compiling

To compile the tutorials from the Linux command line, follow these steps:

  1. CD into the proper folder:

    drivers/sql.jdbc/tutorials/cmdline

  2. Execute make:

    >make

  3. If make works, it prints:

    The jdbc tutorials are ready to run.
    Type 'make run' to run the tutorials.

Running

Be sure the FairCom Database Engine is running.

To run the tutorials from the Linux command line, follow these steps from the same folder you compiled from:

  1. Type the following:

    >make run

  2. The makefile will run each tutorial one-at-a-time.
  3. A prompt will ask you to press <Enter> after each tutorial is run.

Output

The output of the first tutorial project should appear similar to the following:

INIT

Logon to server...

DEFINE

Open table...

Add fields...

Create table...

MANAGE

Delete records...

Add records...

Display records...

1000 Bryan Williams

1001 Michael Jordan

1002 Joshua Brown

1003 Keyon Dooling

DONE

Close table...

Logout...

Press <ENTER> key to exit . . .

Compiling and Running the Tutorials “by Hand”

To compile and run the tutorials individually, without using the batch file, execute the following from the shell (in the parent folder - drivers/sql.jdbc/tutorials):

javac JDBC_Tutorial1.java

javac JDBC_Tutorial2.java

javac JDBC_Tutorial3.java

javac JDBC_Tutorial4.java

To execute the tutorials without using the batch file, run them as follows:

java -cp .:../ctreeJDBC.jar JDBC_Tutorial1

java -cp .:../ctreeJDBC.jar JDBC_Tutorial2

java -cp .:../ctreeJDBC.jar JDBC_Tutorial3

java -cp .:../ctreeJDBC.jar JDBC_Tutorial4

Troubleshooting

This section lists some of the errors that can occur when compiling and running these tutorials:

SQL Exception: 26003 - Connection refused (Connection refused)

The most common cause of this runtime error is that the FairCom Database Engine is not running on your machine. Remember that the c-tree evaluation license times out after 3 hours, so the server might have exited and needs to be re-started. See Starting the FairCom Database Engine.

TOCIndex