The JDBC API is a Java API that can access any kind of tabular data, especially data stored in a Relational Database.
The JDBC API supports both two-tier and three-tier processing models for database access.
JDBC includes four components: The JDBC API, JDBC Driver Manager, JDBC Test Suite, JDBC-ODBC Bridge
This short code fragment instantiates a DriverManager object to connect to a database driver and log into the database, instantiates a Statement object that carries your SQL language query to the database; instantiates a ResultSet object that retrieves the results of your query, and executes a simple while loop, which retrieves and displays those results. It's that simple.
The basic process for a single data retrieval operation using JDBC would be as follows
Connection pooling has become the standard for middleware database drivers. The process of creating a connection, always an expensive, time-consuming operation, is multiplied in these environments where a large number of users are accessing the database in short, unconnected operations. Creating connections over and over in these environments is simply too expensive.
This sample Java program connects to MySQL database using JDBC, executes a query and retrieves and prints the value of the database field.
Most Viewed Articles on JDBC
- Data Science
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews
Subscribe to Tutorials
1. thanks for our help. god bless u and again thanks.
View Tutorial By: mehryab at 2011-05-08 14:44:21
2. nice to read thank you for the notes. that helps m
View Tutorial By: V.Ranjith kumar at 2010-08-12 06:13:03
5. Your code will not execute using above main method
View Tutorial By: Gajanan Patil at 2012-05-09 04:42:29
6. hi .the program does run thank you for that ,i nee
View Tutorial By: mazen at 2008-09-09 04:55:16
9. There is no need to fight. ...whatever ku is sayin
View Tutorial By: saurabh at 2009-07-30 15:19:49