Home » jdbc » Page 2

Tag Archives: jdbc

JDBC with Oracle Thin Driver Example

Bipartite Graph

Java Database Connectivity (JDBC) is a Java-based data access technology that defines how a client may access a database. It provides methods for querying and updating the data in a database. The JDBC classes are contained in the Java package i.e. java.sql and javax.sql.                 1. Introduction In this JDBC Oracle connectivity example, ...

Read More »

JDBC ResultSetExtractor Example

Bipartite Graph

Spring provides a simplification in handling database access with the Spring JDBC Template. The org.springframework.jdbc.core.ResultSetExtractor interface is a callback interface used by JdbcTemplate’s query methods. Implementations of this interface perform the actual work of extracting results from an SQL ResultSet object. In this article, we will try to show how the ResultSetExtractor mechanism can be applied to a Java application.   ...

Read More »

JDBC DDL Example

Bipartite Graph

Data Definition Language (DDL) is a unique set of SQL commands that lets you manipulate the structure of the database. In this article, we will try to show how the JDBC DDL mechanism can be applied to a Java application.               1. Introduction It might sound like its own programming language, but Data Definition ...

Read More »

JDBC Connection Pool Example

Bipartite Graph

Connection pooling is a mechanism to create and maintain a collection of JDBC connection objects. The primary objective of maintaining the pool of connection object is to leverage re-usability and improve the overall performance of the application. In this article, we will try to show how connection pooling mechanism can be applied to a Java application. 1. Introduction JDBC stands ...

Read More »

JDBC Best Practices Tutorial

Bipartite Graph

Hello, in this tutorial we will learn some Java Database Connectivity (JDBC) best practices that Java programmer should follow while writing JDBC code. You can also check our Java Programming Database Tutorial in the following video: Java Programming Database Tutorial – Video JDBC API is used to connect and interact with the relational databases to perform CREATE, READ, UPDATE, DELETE ...

Read More »

JDBC Servlet Example

In this example, we will see how to make use of JDBC from a servlet to access database and read data from table. We will use MySQL as the database and MySQL Workbench as the client for database to prepare the data. However this example does not cover installation of MySQL and MySQL Workbench. We will be using Eclipse as ...

Read More »

JDBC Connection Strings for Popular RDBMS

Bipartite Graph

1. Introduction In Java applications, JDBC (Java DataBase Connectivity) API is used for connecting to relational databases from clients. The API uses Drivers which are nothing but Java library files exposed by different database vendors and Connection Strings/URLs to connect to the databases. Of course, there are other parameters that could be specified like username, password, the database schema to ...

Read More »

JDBC Batch Update Example

Bipartite Graph

1. Introduction This article presents a simple example of performing JDBC Batch Update. It assumes that the reader is familiar with the JDBC (Java DataBase Connectivity) API which is just one of the tools in Java for connecting to a database from a client. The API provides several simple methods for querying and updating data in a database.     ...

Read More »

Tomcat connection pool configuration example

1. Introduction In this example we will discuss Apache Tomcat Servlet/JSP container’s connection pull configuration via JNDI (Java Naming and Directory Interface ) resources. The connection pool we will look at is javax.sql.DataSource, which is a JDBC API for getting a connection instance to a database. In this example we will discuss setting a global DataSource for MySQL database. javax.sql.DataSource ...

Read More »

JDBC DatabaseMetaData Example

Bipartite Graph

In this example will talk about how to get the Database’s Metadata and what is the usefulness of that information for our development, through the Java API JDBC java.sql.DatabaseMetaData . 1. What is the Metadata ? The Database’s Metadata is information about the data, what? Yes, is data about data, of which are two types of data, structural metadata about ...

Read More »