What is JDBC?
- JDBC stands for Java DataBase Connectivity.
- The way every Java application connects to a database is through the JDBC API.
- The JDBC API defines interface and classes for writing database application in Java by making database connections.
- Any information is data, Here data can be raw or processed.
- Application data refers to a set of information that comes in the scope of the application.
- Program is to process data.
- From where this data comes from?
- Where processed data has to go?
- Application is designed to simulate some system.
- The system can be anything like a shopping mall, university, production house, office, etc.
- System requires to preserve data, Likewise
- In offices, employee attendance records
- In hostels, History bookings
- In banks, Transaction details of financial year.
- Database is a set of files containing application data.
- This data needs to be inserted, deleted, updated, extracted for a valid reason.
- You can write programs to perform all such actions.
- Or you can use readymade database management software like Oracle or MySQL.
It includes APIs for each of the tasks mentioned below that are commonly associated with database usage.
- Making a connection to a database.
- Creating SQL or MySQL statements.
- Executing SQL or MySQL queries in the database.
- Viewing & Modifying the resulting records.
Applications of JDBC
JDBC is a specification that provides a complete set of interfaces that allows for portable access to an underlying database. Java can be used to write different types of executables, such as −
- Java Applications
- Java Applets
- Java Servlets
- Java ServerPages (JSPs)
- Enterprise JavaBeans (EJBs).