Java Database Connectivity

Java Database Connectivity (JDBC) is Java's API for interacting with the relational databases. JDBC is a specification interface, while individual database vendors develop the drivers library adhering to JDBC.

The following is the syntax for a simple database connection and query execution to obtain the results into the object called ResultSet:

Connection dbConn = DriverManager.getConnection(databaseURL, username, password);Statement qryStmt = dbConn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);ResultSet queryResults = qryStmt.executeQuery("SELECT <COLUMNS TO RETRIEVE> FROM <TABLES / VIEWS ALONG WITH CRITERIA>");

Here is the sample program for an UpdatableResultSet to retrieve, ...

Get Distributed Computing in Java 9 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.