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. this article is excellent....solve all my doubt re
View Tutorial By: pramodk at 2011-07-18 14:22:18
2. the above is perfect, but when i hit the export bu
View Tutorial By: CH at 2009-06-02 03:01:34
4. Cant be compiled, i got error with this msg:. cann
View Tutorial By: ken at 2011-04-17 04:32:36
6. Daniel, i think you need another func, also you ca
View Tutorial By: רופא שיניים at 2009-08-15 16:48:07
7. hi this is very helpful........thank you very much
View Tutorial By: sumalatha at 2010-06-07 02:16:37
8. Your explanation is perfectly clear and not in nee
View Tutorial By: Percy at 2009-06-08 14:14:39
9. Your post helped me to resolve the SSH exception..
View Tutorial By: Ashwini at 2008-07-14 12:47:32
10. Hi , instead of using localhost. I am using a mobi
View Tutorial By: ashish at 2011-02-28 05:05:49