Blog Archives
1 … 18 19 20 21 22 23 24 25 26 … 30

Apache HTTPClient Tutorial to invoke RESTFul service

Apache HttpClient to invoke a RESTful Web Service. This is a GET request, and in the next post will extend this to use an HTTP POST with basic authentication.

Step 1: Create a Maven project say “httpRestClient”. Just press enter for all the prompts.

…

Read more ›



Apache POI reading a xlsx file tutorial

Apache POI is a popular API that allows programmers to create, modify, and display MS Office files using Java programs. This tutorial shows how to read a xlsx file using Apache POI.

Difference between HSSF and XSSF?

HSSF is the POI Project’s pure Java implementation of the Excel ’97(-2007) file format.

…

Read more ›



Apache POI writing to a xlsx file tutorial

This extends the tutorial Apache POI reading an xlsx file tutorial.

Step 1: The “WriteToExcelFile” Java code.

The xlsx file “employee-out.xlsx” will be created without any formatting.

Step 2: Adding styles

1) The columns are auto sized.

…

Read more ›



Apache POI writing to xlsx with styles

This extends the previous tutorial of Apache POI writing to an excel file by using a blank template employee-blank.xlsx file to be filled with data. The blank xlsx brings in the style and labels.

Step 1: employee-template.xlsx

apache-poi-blank-xlsx

Step 2: writing to xlsx file using poi

Step 3: employee-out.xlsx

apache-poi-xlsx-output

…

Read more ›



Auditing database tables Oracle tutorial

Triggers give you control just before data is changed and just after the data is changed. This allows for: 1) Auditing tables for changes like update, insert, and delete. 2) Data validation and column formatting before and after inserts into database. Q. … Read more ›...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


Basic Apache Camel and Spring tutorial

The Apache camel tutorial below creates a route to poll the c:/temp/simple folder every minute (i.e. 60000 milliseconds) for files with patterns like test1.csv, test2.csv, etc. These files are then zipped and copied to the archive folder under c:/temp/simple.

camel-with-spring

Step 1: Define the Apache camel and spring libraries required.

…

Read more ›



Basic Spring batch tutorial with Maven and Eclipse.

Batch jobs with Spring batch framework is very common and popular. This tutorial assumes that

1) You have set up you Java, Maven, and Eclipse

Once you have followed the following steps, you should have a project structure as shown below.

spring-batch-tut-1

Step 1: Create a new Maven project with the command shown below.

…

Read more ›



BeanIO Java tutorial

BeanIO is an open source Java framework for marshaling and marshaling Java beans from a flat file, stream, or simple String object. It is very powerful with support for XML, CSV, delimited and fixed length stream formats, Object binding, filed validation, integration with spring-batch, etc. Here is a basic tutorial to get started.

…

Read more ›



Before running a Spark job on a YARN cluster in Cloudera and about the Spark history server

Problem: When you run a Spark job via “spark-submit” command on a “YARN” cluster as shown below in a terminal,

It creates a folder and files in HDFS under

The files will be named with “application ids” like “application_1510971789108_0015”. … Read more ›...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


CDI annotations @Named and @Inject Dependency Injection in Spring 3.0 Tutorial

In Spring 3.0 the support for the CDI annotations @Named and @Inject are provided.

1) @Inject instead of Spring’s @Autowired to inject a bean.
2) @Named instead of Spring’s @Component to declare a bean.

Step 1: Create a simple Maven project.

…

Read more ›



Checkstyle & Maven Tutorial

Step 1: The pom.xml with the checkstyle plugin and properties.

Step 2: The checkstyle files that define the rules.

src/main/resources/checkstyle/myapp-checks.xml

src/main/resources/checkstyle/myapp-suppressions.xml

Step 3: Running via mvn command.

…

Read more ›



Converting POJOs to Pentaho meta objects and then passing to a Kettle transformation

This extends the tutorials on Pentaho DI 1) Part 1: Pentaho with user defined Java transformer tutorial. 2) Part 2: Invoking a Pentaho DI (i.e. Kettle) transformation from Java. 2) Part 3: Passing Pentaho DI (i.e. … Read more ›...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


Creating a Maven profile to compile using a different JDK version tutorial

Profiles are very handy in maven to use different JDK versions, include different files for different environments, etc.

Step 1: Say you have a pom.xml file using Java 7 to compile.

Step 2: Say now you want to compile using Java 1.5.

…

Read more ›



1 … 18 19 20 21 22 23 24 25 26 … 30

300+ Java Interview Questions - FAQs

Tutorials on Java & Big Data