Skip to main content

This Knowledge Base (KB) article provides detailed steps for connecting a JDBC CData driver in a Debian Linux system through a VirtualBox VM. This guide assumes that you have the necessary software installed, including VirtualBox, Debian Linux, and the CData JDBC driver. 

Prerequisites: 

  1. VirtualBox: Ensure VirtualBox is installed on your host machine. Download here

  1. Debian Linux: Have one of the Debian Linux distributions installed on your virtual machine. 

  1. CData JDBC Driver: Download and install the CData JDBC driver for your specific database. Download here

  1. WinSCP: Install WinSCP on your system. Download here

Step 1: Set Up Oracle VM Networking 

  1. Open VirtualBox and select your Debian virtual machine. 

  1. Go to Settings > Network > Adapter 1. Ensure that the adapter is set to NAT or Bridged Adapter based on your network configuration. Note: Bridged adapters are not supported over Wi-Fi. 

Step 2: Start the VM on the Oracle VirtualBox 

  1. Launch the VM and connect using the username and password. If you’re setting this up for the first time, you may need to check for default credentials from your Linux distribution’s website. 

  1. Log in to the host on WinSCP to transfer the downloaded Linux JDBC zip to Debian. 

 

 

Step 3: Connect to Linux from PowerShell and test the connection. 

  1. Connect to your Debian system by running the following command: 

  • ssh <yourusername>@<your Linux VM IP> 

 

 

  1. Find the Linux system IP by running the command on your VirtualBox machine: 

  • ip addr sh 

 

 

  1. Check whether Java is installed on your Linux Machine by running the command: 

  • java –version 

 

If not installed, use the following commands to install Java: 

  • sudo apt install openjdk-17-jdk 

 

  1. Unzip the JDBC driver. 

 

Install the Unzip utility and unzip the JDBC file: 

  • sudo apt install unzip 

  • Unzip <zip file name> 

 

Once unzipped, you will see the following directories. 

 

 

  1. Before executing the JAR file, ensure the package is updated. Run the following commands to upgrade the JDK as well as Debian: 

  • sudo apt update 

  • sudo apt upgrade 

 

  1. Finally, execute the JAR file using the following command: 

  • java -jar <your-application.jar> -c <your connection string> -g <logfile location> -v <verbosity level> 

 

Additional Point: 

  1. Environment Variables: If your JDBC driver requires environment variables to be set, make sure to configure them appropriately. Check the documentation of the CData JDBC driver for any specific environment variable requirements and set them before running your application. 

 

Example: Oracle JDBC driver 

 

If you need to set the Environment Variable, run the below command: 

  • export LD_LIBRARY_PATH=/path/to/your/library 

 

To verify the Environment Variable, run the below command. 

  • echo $LD_LIBRARY_PATH 

Be the first to reply!