Category Archives: JDBC

What are the important paradigms for Developing the Clean Object-Oriented Code?

In this blog post we will discuss about What are the important paradigms for Developing the Clean Object-Oriented Code? We should always keep in mind below key points when you write code in your application: We should use an Interface (or the Super Type) not the implementation. Classes Interacting each other should be loosely coupled among… Read More »

Why we need a database connection pooling

In this post we will talk about Why we need a database connection pooling. Creating a network connection to a database server is expensive process. As creating new database connections is costly and it doesn’t make sense to create a new connection for each transaction that might only take a few milliseconds. Managing database connections in… Read More »

Types of JDBC drivers in java?

Types of JDBC drivers in java In previous post What is Java Database Connectivity (JDBC)? JDBC introductory post we talked about what is JDBC API and  we also knew JDBC driver is the one who helps JDBC to connect with database In this post we will talk about all the types of drivers available in JDBC… Read More »

What is Java Database Connectivity (JDBC)?

What is Java Database Connectivity (JDBC)? Java Database Connectivity (JDBC) is an application program interface (API) specification for connecting programs written in Java to popular databases (RDBMS). JDBC APIs are the part of the Java Standard Edition platform. It provides methods to query and update data in a database (RDBMS) and is oriented towards relational… Read More »

Hikari Connection Pooling Example

In Previous few Posts We had learnt about following Database Connection Pools: MysqlDataSource example DBCP Connection Pooling Example C3P0 JDBC connection pool Example BoneCP connection pool example In this post we will learn about Hikari Connection Pooling with JDBC. Note:You have to add few dependencies binaries in your project class path those dependencies you can see in… Read More »

BoneCP connection pool example

In Previous few Posts We had learnt about following Database Connection Pools: MysqlDataSource example DBCP Connection Pooling Example C3P0 JDBC connection pool Example In this post we will learn how to establish Jdbc connection pool using BoneCP Note:You have to add few dependencies binaries in your project class path those dependencies you can see in… Read More »

C3P0 JDBC connection pool Example

In previous couple of posts  MysqlDataSource example and DBCP Connection Pooling Example we learnt about how to take JDBC connection using  MysqlDataSource and Apache DBCP connection pools In this post we will learn how to take JDBC connection from C3P0 Connection pool. Note:You have to add few dependencies binaries in your project class path those dependencies you can see in… Read More »

DBCP Connection Pooling Example

In previous post MysqlDataSource example we learnt about how to take JDBC connection using  MysqlDataSource connection pool In this post we will learn about DBCP Connection Pooling using an example Note:You have to add few dependencies binaries in your project class path those dependencies you can see in the blow project lib folder  Project structure in eclipse: Create database.properties file in src folder… Read More »

MysqlDataSource example

In this post we will learn about MysqlDataSource using an example Project structure in eclipse: Create database.properties file in src folder as shown in the above project structure and make entry of below properties.

SQL Query to create employee_table in MySQL (jdbcpooldb schema)

Once you execute above db script your database schema(jdbcpooldb) will be created and employee_table… Read More »

How to get primary key value (auto-generated keys) from inserted queries using JDBC?

In this post we will learn How to get primary key value (auto-generated keys) from inserted queries using JDBC? Project structure in eclipse: SQL Query to create employee_table in MySQL (jdbcdb schema)

DBUtil.java class which is responsible to connect with MySQL database. 

Model class Employee.java 

DAO Interface and It’s implementation 

Now let’s run… Read More »