In This Article 


Oracle Database Connection Steps 

GenRocket can connect to any Oracle database version as long as a JDBC driver is available. 

Step 1 - Create a JDBC Config File (config.properties)

For GenRocket to connect to an Oracle database via JDBC, you must create a JDBC Config or config.properties file. Any application can connect to an Oracle database via JDBC using the information included in this file. Click here to learn more.


A template is provided below:
 

driver=<JDBCDriverClassName>
user=<userToConnectToDatabase>
password=<passwordToConnectToDatabase>
url=jdbc:oracle:thin:@<url>:<port>:<databaseName>
batchCount=1000


Example config.properties for Oracle database

GenRocket will read this config file and connect to an employee database on localhost using username root and password root.


driver=oracle.jdbc.driver.OracleDriver
user=root
password=root
url=jdbc:oracle:thin:@localhost:1521:employee
batchCount=1000


Note: TNS Configuration

To connect using a TNS configuration, use the following connection string in the url property:

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=servername)(PORT=portnumber))(CONNECT_DATA=(SERVICE_NAME=servicename)))


Step 2 - (Optional) Encrypt the JDBC Config file

You can encrypt this file for additional security. Click here to learn more. 

Step 3 - Update Your JDBC Organization Resource Value

The resource.jdbc.config Organization Resource specifies the location of the JDBC Config file on the logged in user's local machine. This resource value should contain the full directory path (e.g., /home/user/dev). Click here for more information.


Step 4 - Update your Profile in the .genrocket Folder

Each user has a profile stored in the .genrocket folder on their local machine. You must download and replace your profile (in ~/.genrocket folder). GenRocket will read this resource value from your profile on your system to make a connection with the database. Click here for more information.


Step 5 - Download and place the JDBC connector Jar file in the $GENROCKET_HOME/lib/ folder


Step 6 - Test the JDBC Connection

You can test the JDBC connection before referencing the resource in GenRocket. Click here to learn more. 


Step 7 - Reference the JDBC Resource as Needed

When you create a Scenario containing a Generator or Receiver that references your jdbc.config resource, it will connect directly to your database. GenRocket feature that uses a database connection will also need to reference this file. 


Troubleshooting 

java.lang.NoClassDefFoundError: oracle/xdb/XMLType Error 

If you face an exception that says: java.lang.NoClassDefFoundError: oracle/xdb/XMLType, then please download xdb6.jar from this link and place the Jar inside of $GEN_ROCKET_HOME/lib folder. Or you can download the xdb6.jar we attached to this article if you are using Oracle Database 11g Release 2 (11.2.0.4) version. 


Missing the Value for property, sqlldr

This error was received when inserting records into an Oracle database using G-Migration+ and could be encountered in other situations as well. The full error is shown below: 


com.genRocket.GenRocketException: Resource, C:\Users\jdoe\output\config.properties is missing the value for property, sqlldr.


To resolve this issue, please include the sqlldr property and the full path to the Oracle sqlldr in your JDBC configuration file. An example is provided below: 


driver=<JDBCDriverClassName>
user=<userToConnectToDatabase>
password=<passwordToConnectToDatabase>
url=jdbc:oracle:thin:@<url>:<port>:<databaseName>
sqlldr=<pathToFile>
batchCount=1000


If you have installed Oracle client on your machine, the sqlldr.exe file will already be there, and no other steps are required. If not, click here to learn more about setting up the Instant Client for SQL Loader.


Need Additional Help? 

If you still need help connecting to your Oracle database via JDBC, please contact support@genrocket.com