Run a Java Program
In this example, we connect to the Ingres II instance to testdb database and run the Java program named jdbc_connect_example.
The program is in the directory: /usr/jdbc_connect_example.java.
JDK 1.8 (64 bit) is required to compile the program.
To configure your environment
1. Open a shell prompt.
2. Ensure that you have a javac executable in your PATH variable pointing to the JDK installation. For example:
set PATH=/opt/Java/jdk1.8.0_45/bin:$PATH.
Note: The path may be different on your system depending on your JDK version.
3. Add iijdbc.jar and directory containing the Java program to CLASSPATH. For example:
set CLASSPATH=/opt/Actian/IngresII/ingres/lib/iijdbc.jar;/usr:$CLASSPATH
To compile and run the program
1. From the command prompt, configured as in the previous steps, change directory to the directory containing the Java program:
cd ./usr
2. Compile the program:
javac jdbc_connect_example.java
3. Run the program:
java jdbc_connect_example
Last modified date: 08/28/2024