Home » core java » Page 11

Tag Archives: core java

JAX-RS Web Service Example

Hello readers. In this tutorial, we will show how to use the JAX-RS (RESTful) jar files to implement a simple Hello World Web Service in Java. 1. Introduction JAX-RS stands for RESTful Web Services. JAX-RS is a set of APIs to develop the REST services. It is part of the Java EE6 and makes developers to develop the REST web ...

Read More »

Java Servlet RequestDispatcher Tutorial

Communication between the Servlets is an important task to the programmer. Request Dispatcher is an interface whose implementation defines an object which can dispatch the request to any resources on the server. In this tutorial, we will see how the javax.servlet.RequestDispatcher interface is used to forward or include the response of a resource in a Servlet.         ...

Read More »

Java Servlet Application for Login Page

Servlets are modules of the Java code that run in a server application to answer the client requests. They are not tied to a specific client-server protocol but are most commonly used with HTTP. The word “Servlet” is often used in the meaning of “HTTP Servlet“. In this tutorial, we will explain how to handle the Servlet HTTP POST Request ...

Read More »

JPA persistence.xml Example

Hello readers! In this tutorial we will show how to implement the Java Persistence API and define the JPA Persistence Units with EclipseLink and MySQL in Java. 1. Introduction Java Persistence API (JPA), is a standard interface which wraps the different Object Relational Mapping (ORM) tools such as Hibernate, EclipseLink, OpenJPA etc. JPA provides a javax.persistence.EntityManager interface which is used ...

Read More »

JPA CriteriaBuilder Example

The Criteria API is a predefined API used to define queries for entities. It is the alternative way of defining a JPQL query. These queries are type-safe, portable and easy to modify by changing the syntax i.e. the JPA queries are mainly used for building the dynamic queries whose exact structure is only known at the runtime. In this tutorial, ...

Read More »

Java MongoDB Example

MongoDb is the leading NoSQL database system which has become popular due to its dynamic schema nature and the advantages over the Big Data like high performance, horizontal scalability, replication etc. Unlike the traditional database systems which provide their own Jdbc-compliant drivers, MongoDb comes with its own in-Jdbc driver called Mongo Java Driver. That means developers cannot use the standard ...

Read More »

Java Nio Delete File Example

If developers are working on a Java Swing or a desktop application then it may be required that sometimes developers need to delete a file from the file system. This tutorial is to learn about handling the files using the Java Nio package and shows how to delete a file in Java using the Nio package.         ...

Read More »

Java Nio Scatter/Gather Example

In Java Nio, the channel provides an important capability known as scatter/gather or vectored I/O in some circles. Scatter/gather is a simple yet powerful concept and this tutorial explains how scatter/gather can be really useful in situations where developers need to separate work with the various parts of the transmitted data.               Table Of ...

Read More »

Java Nio Channels Example

Channels are the second major innovation of the Java Nio after buffers. In Java Nio, channels are used for the input-output transfers and this tutorial explains how the Java Nio Channels are used to open the network connections and connections to the files.                 1. Introduction Java Nio was developed to allow the ...

Read More »

Java Nio BufferOverflowException Example

Exceptions are the unwanted or the unexpected events that occur during the execution of programs that disrupt the normal flow of the instructions. In this tutorial, we will learn about the BufferOverflowException which is very common in the Java Nio package. But before moving ahead let’s take a look and understand the basics of the Java Nio package.     ...

Read More »