tags:

views:

137

answers:

4
+1  Q: 

What is JDBC?

What is JDBC and where can I start learning about?

I know it's a way to access databases with Java, but what problems does it solve? Is it an ORM (or does it try to be)? Does it abstract away differences between databases, at the syntax level? What does it do? and what does it not do?

+3  A: 

No, JDBC isn't an ORM. It's the Java Database Connectivity API and basically it provides a database-agnostic access layer with a provider model (so that new database drivers can be added easily). Vendors can add more functionality for specific database features if they wish, but developers can ignore those features if they wish to work with multiple databases.

There's no mapping involved - just modeling for connections (and pools), prepared statements, stored procedures, result sets etc.

Jon Skeet
A: 

You've practically answered your own question.

It provides a common interface for accessing databases, which means that regardless of the nuances of individual databases, or how they are implemented, your API calls are the same. It is not an ORM.

Winston Smith
+1  A: 

Java Database Connectivity (JDBC) is an API for the Java programming language that defines how a client may access a database. It provides methods for querying and updating data in a database. JDBC is oriented towards relational databases.

Galwegian
+5  A: 

JDBC is a driver that allows you to access database. It provides you with a very raw way to access the database using SQL. Its primary function is to allow you (the user) to run SQL commands on the database. It is not an ORM and never will be. The sun website http://java.sun.com/docs/books/tutorial/jdbc/ has a nice tutorial for JDBC. If you are interested in a ORM try http://www.hibernate.org/.

Josh Moore