JDBC Tutorial

About the author

Daniel Gutierrez Diez holds a Master in Computer Science Engineering from the University of Oviedo (Spain) and a Post Grade as Specialist in Foreign Trade from the UNED (Spain). Daniel has been working for different clients and companies in several Java projects as programmer, designer, trainer, consultant and technical lead.

This tutorial is about JDBC (Java Database Connectivity), an API provided by Oracle that allows programmers to handle different databases from Java applications: it allows developers to establish connections to databases, defines how a specific client can access a given database, provides mechanisms for reading, inserting, updating and deleting entries of data in a database and takes care of transactions composed of different SQL statements.

In this article we will explain the main JDBC components like Statements, Result Sets or Stored Procedures.

JDBC needs drivers for the different databases that programmers may want to work with; we will explain this in detail and we will provide some examples.

JDBC comes together with Java since the beginning of times; the first release came with the JDK 1.1 on February 1997 and since then, JDBC has been an important part of Java. The main packages where JDBC is contained are Package java.sql and Package javax.sql.

All the information about the last JDBC release (4.2) and its development and maintenance can be found in the JSR 221.

All examples shown in this article have been implemented using Java 8 update 0_25 and the Eclipse SDK version Luna 4.4. At the end of the article you can download all these examples and some more!

 

JDBC Tutorial includes:

  1. Components
  2. Connections
  3. Data types
  4. Drivers
  5. Databases
  6. Result sets
  7. Stored procedures
  8. Statements
  9. Batch commands
  10. Transactions
  11. CRUD commands
  12. Java 8
  13. Sql libraries built upon JDBC
  14. Unit Testing
JCG eBooks are professionally designed, downloadable collections of popular JCG content – articles, interviews, presentations, and research – covering the latest software development technologies, trends, and topics.
Back to top button