Connect to MySQL with JDBC driver
A JDBC example to show you how to connect to a MySQL database with a JDBC driver. Tested with:Java 8, MySQL 5.7, MySQL JDBC driver mysql-connector-java:8.0.16
Favourite tutorials for developers
A JDBC example to show you how to connect to a MySQL database with a JDBC driver. Tested with:Java 8, MySQL 5.7, MySQL JDBC driver mysql-connector-java:8.0.16
A JDBC example to show you how to connect to a PostgreSQL database with a JDBC driver. Tested with:Java 8, PostgreSQL 11, PostgreSQL JDBC driver 42.2.5
This is caused by the requested SID doesn’t exist in {ORACLE_HOME}/network/admin/tnsnames.ora . Tested with Oracle database 19c with ojdbc8.jar
A JDBC example to show you how to connect to a Oracle database with a JDBC driver. Tested with:Java 8, Oracle database 19c, Oracle JDBC driver for Java 8, ojdbc8.jar
In this article, we will show you how to create a Spring Boot JDBC application + MySQL and HikariCP. Tools used in this article :Spring Boot 1.5.1.RELEASE, MySQL 5.7.x, HikariCP 2.6, Maven, Java 8
In this article, we will show you how to create a Spring Boot JDBC application + Oracle database + Commons DBCP2 connection pool. Tools used in this article :Spring Boot 1.5.1.RELEASE, Oracle database 11g express, Oracle JDBC driver ojdbc7.jar, Commons DBCP2 2.1.1, Maven, Java 8
Here’s a simple guide to show you how to add an Oracle JDBC driver into your Maven local repository, and also how to reference it in pom.xml. Note: Due to Oracle license restrictions, the Oracle JDBC driver is not available in the public Maven repository. To use the Oracle JDBC driver with Maven, you have to download and install it into your Maven local repository manually.
Spring JdbcTemplate batch insert, batch update and also @Transactional examples. Technologies used :Spring Boot 2.1.2.RELEASE, Spring JDBC 5.1.4.RELEASE, Maven 3, Java 8.
Spring JdbcTemplate example to get a large ResultSet and process it. P.S Tested with Java 8 and Spring JDBC 5.1.4.RELEASE. If the table contains over millions of data, the RowMapper in findAll method will busy converting objects and put all objects into a List, if the object size is larger than the Java heap space. We can increase the heap size, but a better solution is to use RowCallbackHandler to process the large ResultSet on a per-row basis.
In this tutorial, we will show you how to use Spring Boot JDBC SimpleJdbcCall to call a stored procedure and stored function from a Oracle database. Technologies used :Spring Boot 2.1.2.RELEASE, Spring JDBC 5.1.4.RELEASE, Oracle database 19c, HikariCP 3.2.0, Maven 3, Java 8. Unlike JdbcTemplate, Spring Boot didn’t create any SimpleJdbcCall automatically, we have to create it manually. In summary: For Stored Procedure – SimpleJdbcCall.execute, For Stored Function – SimpleJdbcCall.executeFunction