Please send your Questions & Answers or Feedback to "mohan@javabook.org"

Explain Basic Steps in writing a Java program using JDBC?


JDBC makes the interaction with RDBMS simple and intuitive. When a Java application needs to access database :
Load the RDBMS specific JDBC driver because this driver actually communicates with the database (Incase of JDBC 4.0 this is automatically loaded).
Open the connection to database which is then used to send SQL statements and get results back.
Create JDBC Statement object. This object contains SQL query.
Execute statement which returns resultset(s). ResultSet contains the tuples of database table as a result of SQL query.
Process the result set.
Close the connection.
Related Posts Plugin for WordPress, Blogger...
Flag Counter