In this JDBC Oracle connectivity example we will see how to setup a JDBC development environment and create a simple Java database application to connect to Oracle Database Express Edition using JDBC API. We will also see the following important things which are required for connecting to any database using JDBC.
1. Oracle JDBC Connector jar
2. JDBC Oracle Driver class
3. JDBC Oracle Connection String URL
Install Java
Make sure you have Java SE installed in you computer. Refer the links to install Java in Windows,Ubuntu.
Download and install Eclipse IDE
You can code and run a Java program using a simple text editor (such as Notepad) and use command prompt to run the program. Alternatively, you can use any Integrated Development Environment (IDE) (such as Eclipse, NetBeans, etc). We use Eclipse IDE.
Refer this link to install Eclipse IDE.
Download and Install Oracle Database Express Edition
This Oracle JDBC example requires Oracle Database XE (Express edition) which can be downloaded from the following link. http://www.oracle.com/technetwork/products/express-edition/downloads/index.html. Accept the license agreement and download the version for your platform. This tutorial assumes the platform as Windows.
Oracle XE Installation Steps
The Oracle XE installation is very simple. Just unzip the file and run the setup.exe file. Follow the step-by-step installation guide from this link.
Setup a Database
Create Database User
To create database objects, we must create at least one database user. A user is associated with a database schema, you connect to the database as a database user, and the database user is the owner of any database objects (tables, views etc) that you create in the