Home » Core Java

Core Java

XPath parent node example

java-logo

In the previous example, we introduced the dependant axis specifier. In this example, we shall talk about the ancestor axis in XPath Expression. The ancestor tag is used to select the ancestor of the current node and the ancestor of the ancestor and so on in context of the current node. We will look at a few examples to see ...

Read More »

Gradle GWT Integration Example

gradle-logo

This example offers a complete tutorial on how to integrate Gradle & GWT. Then, we see how build a GWT project with Gradle and how to run them on a Jetty Server. 1. Introduction to Gradle GWT Integration GWT is the Google’s Toolkit to develop ajax applications using the Java language, these applications like Java EE’s Applications need a server, but, in this case, is a lightweight web ...

Read More »

XPath ancestor example

java-logo

In this example we will learn how to get the ancestor details of a given node using XPath. We will start with the introduction of XPath – what it is and how to use it, then we will see the working model of the desired functionality. Tools and technologies used in this example are Java 1.6, Maven, Intellij.(Please note you don’t ...

Read More »

XPath descendant example

java-logo

In this example we shall talk about the Descendant axis specifier in XPath. An axis specifier indicates the direction of navigation in DOM tree of that XML document. This helps in effectively querying the XML document. The Descendant axis selects all the descendants of the current node. The ‘descendant’ refers to the children and grand-children of the current node. We ...

Read More »

JDBC Batch Update Example

java-logo

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. Consider a ...

Read More »

Java 7 try-with-resources statement

java-logo

1. Introduction Try-with-resources in Java 7 is a new exception handling mechanism that makes it easier to correctly close resources that are used within a try-catch block. 2. Whats covered in this blog post? Resource Management With Try-Catch-Finally, Old School Style Managing resources that need to be explicitly closed is somewhat tedious before Java 7. printFile() method private static void ...

Read More »

Mockito mock static method example

mockito-logo

In this article, I am going to show you how to mock static methods using Powermockito. PowerMock is an open source mocking library. It extends the existing mocking frameworks, such as EasyMocks and Mockito, to add even more powerful features. One of them being mocking static methods. For more information, read Powermock – Mockito Integration Example. My setup details: I am using Maven – ...

Read More »

XPath innertext selection example

java-logo

In this example we will learn how to select a node with a given inner text using XPath. We will start with the introduction of XPath – what it is and how to use it, then we will see the working model of inner-text selection. Tools and technologies used in this example are Java 1.6, Intellij. 1. Overview An XPath expression ...

Read More »

XPath count example

java-logo

In the previous example, we studied how to use the XPath Concat method. In this example, we will see how to use the count method in XPath. The XPath count() method is used to count the number of nodes matching a given XpathExpression. Let’s look at a few examples to understand how the count method works. Consider the XML file ...

Read More »

Java 7 New IO API Example

java-logo

1. Introduction Java NIO (New IO) is an alternative IO API for Java (from Java 1.4) – it was deemed to be the alternative standard to the Java IO and Java Networking API. Of course, there wouldn’t be a new one if it’s not for the benefits of using it. It does still has the basic file manipulation capabilities but ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close