Without using JDBC, we cannot connect to a database using Java only. JDBC will be involved, either directly or indirectly, in connecting a database. But there are problems faced by Java programmers if they are working directly with core JDBC. Let's see what those problems are.
Spring JDBC configuration
Problems with core JDBC
The following illustrates the problems that we have to face when we work with the core JDBC API:
String query = "SELECT COUNT(*) FROM ACCOUNT";
try (Connection conn = dataSource.getConnection();
Statement statement = conn.createStatement();
ResultSet rsltSet = statement.executeQuery(query))
{
if(rsltSet.next()){
int count = rsltSet.getInt...