O'Reilly logo

Oracle Database Programming using Java and Web Services by Kuassi Mensah

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

Chapter 6. Introducing the JDBC Technology and Oracle’s Implementation

JDBC Primer

Before diving into the details, let’s first introduce the technology. Readers who are already familiar with JDBC may want to skip this section, or revisit it!

First Steps in JDBC

The basic JDBC steps include loading and registering the driver, connecting to the database, creating a statement object, executing the query, processing the results, and closing the resources.

Step 1: Loading and Registering the Driver

Loading and registering the driver can be achieved in your code using either DriverManager.registerDriver or Class.forName; in case something goes wrong, the first method throws a SQLException and the second throws a ClassNotFoundException:

DriverManager.registerDriver ...

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