Steps in Java application to access database :
1. Load JDBC driver
This RDBMS specific driver actually communicates with the database.
Not applicable for JDBC 4.0 as driver is automatically loaded.
2. Open Connection
Connection is used to send SQL statements and get results back.
3. Create Statement
JDBC Statement object contains SQL query.
4. Execute statement
Executes statement which returns resultset(s)
ResultSet contains the tuples of database table as a result of SQL query.
5. Process ResultSet
6. Close the connection
No comments:
Post a Comment
Note: only a member of this blog may post a comment.