No results found

Your search did not match any results.

We suggest you try the following to help find what you're looking for:

  • Check the spelling of your keyword search.
  • Use synonyms for the keyword you typed, for example, try “application” instead of “software.”
  • Try one of the popular searches shown below.
  • Start a new search.


Trending Questions

Develop Java applications with Oracle Database using JDBC

This quick start guide helps Java developers to successfully establish a connection to the Oracle Database. Follow these easy steps to get started:

Step 1: Prerequisites

Step 2. Setting up the Connect String

  • Download or from Github
  • Modify the Java code and Update the Database Credentials of the database that you have access to.

    (a) Change the connect string to use your database's username, password, host name/IP address, database service name, and port number,

    Example: DB_URL = "jdbc:oracle:thin:@myhost:1521/myorcldbservicename" DB_USER = "hr" and DB_PASSWORD ="hr"

    (b) Sample code uses the HR.EMPLOYEES table. If you do not have the HR schema in your database, modify the tables and columns in the code to use a table that you do have access to or even use a simple query "Select sysdate from dual" for testing purposes.

Step 3. Build and Run a Sample Java Program

  • Compile the Java code

    javac -classpath ./pb/ojdbc8.jar:.

    javac -classpath ./pb/ojdbc8.jar:./pb/ucp.jar:.

  • Run the sample Java program

    java -classpath ./pb/ojdbc8.jar:. DataSourceSample

    java -classpath ./pb/ojdbc8.jar:./pb/ucp.jar:. UCPSample

  • 1 If you have JDK7 or JDK6 then you must use ojdbc7.jar or ojdbc6.jar from or Use "java -version" to check the JDK version that you have installed. Use "java -jar -ojdbc8.jar" to check the JDBC driver version.