O'Reilly logo

Java™ Oracle® Database Development by David J. Gallardo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting to the Database

The hardest thing about using JDBC is usually getting the JDBC drivers to connect to the database in the first place. The principle difficulty is because we need to get three different things working together: our Oracle database, our Java development environment, and the JDBC drivers to connect the Oracle database and our Java programs.

There are numerous options and alternatives for connecting, many of which we'll explore in the next chapter, but for now we'll start with the basics. These are the steps required to connect to the database:

  • Setting up the Oracle, Java, and JDBC environment
  • Importing the JDBC classes we need
  • Loading and registering the JDBC driver
  • Getting a Connection object from the driver

Setting up the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required