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. What datatype can we give to a variable St
View Tutorial By: Bafokeng Lebesa at 2012-11-27 12:35:40
2. I used HyperTerminal directly to check whether mod
View Tutorial By: Pugal at 2009-10-15 03:38:08
7. Guys, txtWeb is back with their National Level Dev
View Tutorial By: rahul.del at 2012-08-16 10:01:09
8. i m new in java plz send package of simple program
View Tutorial By: iqbal ahmad at 2009-09-07 01:26:41
10. Thanks Man , You are Genius i have been looking fo
View Tutorial By: hamza Ouni at 2015-02-22 13:38:02