How to read an excel file in java

Microsoft excel is the most widely used program to maintain data. Hence it becomes vital that the data from an excel sheet be read directly to a java program so that it may be used further to dump into a database or written to an XML file. Java itself does not provide any features to perform excel related operations but there are external libraries written in java which support this. Two of the common libraries are Apache POI and jexcel (or jxl). Both of them provide convenient methods to handle excel files. This post will be using jexcel (or jxl) api for its demonstration. (more…)

Continue Reading

How to write an excel file in java / How to write data to excel in java

Microsoft excel is the most widely used program to maintain data. Hence it becomes vital that the data from a java program be directly written to an excel file in different rows and columns. Java itself does not provide any features to perform excel related operations but there are external libraries written in java which support this. Two of the common libraries are Apache POI and jexcel (or jxl). Both of them provide convenient methods to handle excel files. This post will be using jexcel (or jxl) api for its demonstration.

(more…)

Continue Reading

How to get current date in java / Various ways to get the current date in java

Most applications require calculating current date for different reasons. It may be for logging events, for saving the creation, updation or deletion time of entities, recording the login details of a user and so on. Java provides different methods to calculate current date and time. Following article explains different methods to obtain current date and/or time in java. (more…)

Continue Reading

How to implement Stack in java / Custom Stack implementation in java using different methods

What is Stack ?

A linear data structure which stores newly added items at its top and retrieves newly added items from its top. Consider a pile of books where each new book added to the pile is placed at its top and at the time of removal, the book at the top is removed. A stack works on LIFO (Last In First Out) principle and supports only two operations : (more…)

Continue Reading
Close Menu