schneide.wordpress.com schneide.wordpress.com

JDBC’s wasNull method pitfall

Java’s java.sql package provides a general API for accessing data stored in relational databases. It is part of JDBC (Java Database Connectivity). The API is relatively low-level, and is often used via higher-level abstractions based on JDBC, such as query builders like jOOQ, or object–relational mappers (ORMs) like Hibernate. If you choose to use JDBC directly you have to be aware that the API relatively old. It was added as part...

baeldung

JDBC URL Format For Different Databases

1. Overview When we work with a database in Java, usually we connect to the database with JDBC. The JDBC URL is an important parameter to establish the connection between our Java application and the database. However, the JDBC URL format can be different for different database systems. In this tutorial, we'll take a closer look at the JDBC URL formats of several widely used databases: Oracle, MySQL, Microsoft SQL Server, and...

javarevisited

How to call Stored Procedures from Java using IN and OUT parameter - Spring Framework Example Tutorial

Spring Framework provides excellent support to call stored procedures from Java application. In fact, there are multiple ways to call stored procedures in Spring Framework, e.g. you can use one of the query() method from JdbcTemplate to call stored procedures, or you can extend abstract class StoredProcedure to call stored procedures from Java. In this Java Spring tutorial, we will see the second approach to call a stored procedure....

knpcode.com knpcode.com

JDBC Batch Insert Update Example

In this tutorial we’ll see how to do a batch insert or update using JDBC batch processing. If you have to run a large number of SQL statements it is much more efficient to run them as a batch rather than as individual commands hitting the DB for each command. Methods for batch processing in JDBC In JDBC Statement interface there are following methods for batch support- addBatch(String sql)– Adds the given SQL command to the list...