Home » core java » Page 12

Tag Archives: core java

Java Nio SocketChannel Example

SocketChannel is a selectable channel belonging to the java.nio.channels package and is used for reading or writing the stream-oriented data. In this tutorial, we learn how to use the SocketChannel and how it is used for reading or writing the stream-oriented data by using the TCP based protocol.               1. Introduction Java Nio was ...

Read More »

Java Nio Download File From Url Example

Java NIO (i.e. new I/O) is an interesting file input-output mechanism introduced in Java 5 and provides the different way of working with the input-output operations than the standard input-output API’s. Java NIO supports a buffer-oriented, channel-based approach for the I/O operations and with the introduction of Java 7, the NIO system has expanded thereby providing the enhanced support for ...

Read More »

Java Nio Create Directory Example

Java NIO (i.e. new I/O) is an interesting file input-output mechanism introduced in Java 5 and provides the different way of working with the input-output operations than the standard input-output API’s. Java NIO supports a buffer-oriented, channel-based approach for the I/O operations and with the introduction of Java 7, the NIO system has expanded thereby providing the enhanced support for ...

Read More »

Java Nio Append File Example

Java NIO (i.e. new I/O) is an interesting file input-output mechanism introduced in Java 5 and provides the different way of working with the input-output operations than the standard input-output API’s. Java NIO supports a buffer-oriented, channel-based approach for the I/O operations and with the introduction of Java 7, the NIO system has expanded thereby providing the enhanced support for ...

Read More »

Apache Ant Tutorial for Beginners

This tutorial explains why Java Apache Ant was created and its advantages over other build tools. It also covers the installation of Ant and what goes into a java ant project. 1. Apache Ant Tutorial – Introduction In this tutorial, a sample project is set up. The Ant build file, for the sample project, is explored along with a discussion ...

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 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 »

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. 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 »

Java 9 Functional Programming Tutorial

Hello, in this tutorial we will learn about the introduction to Functional Programming in Java 9. The idea behind this approach was to combine Haskell programming language in Java. Table Of Contents 1. Java 9 Functional Programming 1.1 All variables are final 1.2 Don’t use global variables (and forget about side effects) 1.3 Use functions as parameters 1.4 Lambda Expressions ...

Read More »