Home » Tag Archives: JDBC

Tag Archives: JDBC

Understanding Connection Pooling

java-interview-questions-answers

1. Introduction Connection Pooling is a technique to boost application’s performance where N connections to the database are opened and managed in a pool. The application just asks for a connection, uses it and then drops it back to the pool. When the application demands for a connection, the ready connections are kept available to used in the pool. The pool manages ...

Read More »

SpringBoot : Working with JdbcTemplate

spring-interview-questions-answers

Spring provides a nice abstraction on top of JDBC API using JdbcTemplate and also provides great transaction management capabilities using annotation based approach. First let’s take a quick look at how we generally use Spring’s JdbcTemplate (without SpringBoot) by registering DataSource, TransactionManager and JdbcTemplate beans and optionally we can register DataSourceInitializer bean to initialize our database. @Configuration @ComponentScan @EnableTransactionManagement @PropertySource(value ...

Read More »

Easy Database Manipulation with Groovy and Gradle

Groovy:  The “Enterprise Hipster” Language Not everyone sees the Java programming language as sexy.  However, the Java virtual machine is a dominant force everywhere, from the most conservative enterprise to the most whimsical startup.  There are myriad alternative languages today that compile to Java bytecode.  There are JVM-based versions of Python, Ruby, and multiple implementations of JavaScript.  There are entirely new ...

Read More »

Using the JDBC Insert Features in Oracle

java-interview-questions-answers

Introduction In this article I will show an example of how to use the JDBC bulk insert features supported by Oracle — and which are specific to Oracle. For more details on why one might like to resort to using bulk inserts in general, e.g., performance considerations when certain circumstances warrant, see the JCG article, “JDBC Batch Insert Example ” ...

Read More »

How does the MySQL JDBC driver handle prepared statements

Prepared statement types While researching for the Statement Caching chapter in my High-Performance Java Persistence book, I got the chance to compare how Oracle, SQL Server, PostgreSQL and MySQL handle prepare statements. Thanks to Jess Balint (MySQL JDBC driver contributor), who gave a wonderful answer on StackOverflow, I managed to get a better understanding of how MySQL handles prepared statements ...

Read More »

Why you should always use connection pooling with Oracle XE

java-interview-questions-answers

Introduction Oracle Express Edition is the free version of Oracle Enterprise Edition and its smaller size makes it very convenient for testing various Oracle functionalities. According to Oracle documentation, the Express Edition can use at most one CPU and 1 GB of RAM, but in reality there are other limitations that are not always obvious. Database connection handling anomaly The ...

Read More »

Installing PostgreSQL PL/Java as a PostgreSQL Extension

In 2011 I wrote a series of articles on PostgreSQL PL/Java. The basic information is still solid but there is a now a much easier way to install PL/Java from source. This also eliminates the need to depend on third parties to create packages. These notes will be fairly brief since I assume my readers are already familiar with git ...

Read More »

What’s Even Harder Than Dates and Timezones? Dates and Timezones in SQL / JDBC!

There was an interesting discussion recently on the jOOQ mailing list about jOOQ’s current lack of out-of-the-box support for TIMESTAMP WITH TIME ZONE data types. No one said that date, time and timezones are easy! There’s an amusing piece here, which I recommend reading: Falsehoods programmers believe about time And when that’s not enough, read also: More falsehoods programmers believe ...

Read More »

Let’s Review How to Insert Clob or Blob via JDBC

java-interview-questions-answers

LOBs are a PITA in all databases, as well as in JDBC. Handling them correctly takes a couple of lines of code, and you can be sure that you’ll get it wrong eventually. Because you have to think of a couple of things:                   Foremost, LOBs are heavy resources that need special ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns