Home » Author Archives: Yatin (page 24)

Author Archives: Yatin

Yatin
The author is graduated in Electronics & Telecommunication. During his studies, he has been involved with a significant number of projects ranging from programming and software engineering to telecommunications analysis. He works as a technical lead in the information technology sector where he is primarily involved with projects based on Java/J2EE technologies platform and novel UI technologies.

Java JDBC MSSQL Connection Example

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 article, we will describe ...

Read More »

JDBC Query Builder Tutorial

Handling SQL within a Java application can be tricky. For one thing, Java does not support multi-line string constants, so developers can end up with code that looks like this:                     Sample Code String sql_query = "select *" + "from user_table" + "where name like 'Fred%'"; This code is not just ...

Read More »

JDBC Nested Transactions Example

A nested transaction is used to provide a transactional guarantee for a subset of operations performed within the scope of a larger transaction. Doing this allows us to commit and abort the subset of operations independently of the larger transaction. This operation is theoretically possible, however, in JDBC 3.0 we can’t achieve this as easily as the definition looks. In ...

Read More »

JDBC with Oracle Thin Driver Example

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

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 »

Logging System.out.println Results in a Log File Example

In Java the three main streams stdin (Standard Input), stdout (Standard Output), and stderr (Standard Output Error) are handled by default by System.in, Sytem.out, and System.err respectively. In this example, we will try to show how to redirect the System.out.println() to a log file using Log4j logging services. 1. Introduction Printing messages to the console is an integral part of ...

Read More »

JDBC DDL Example

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

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

Hello, in this tutorial we will learn some Java Database Connectivity (JDBC) best practices that Java programmer should follow while writing JDBC code. JDBC API is used to connect and interact with the relational databases to perform CREATE, READ, UPDATE, DELETE (commonly known as CRUD) operations. It is a database-independent API that you can use to execute your queries against ...

Read More »

Hibernate Example Code Using Annotations

Hibernate annotations is the powerful way to provide the metadata for the Object and Relational Table mapping. All the metadata is clubbed into the POJO Java file along with the code which helps the user to understand the table structure and POJO simultaneously during the development. In this tutorial, we will explain how to configure Hibernate annotations to define mapping ...

Read More »