Export ResultSet to Excel file in Java

EasyXLS™ library allows you to export a ResultSet to an Excel file. The data in cells can be formatted using predefined formats or user-defined formats.

EasyXLS can be successfully used inclusively to export large Excel files having big volume of data with fast exporting time.

EasyXLS permits you to export Excel files without Excel installed or any other additional software installed.

Source code sample

The below example shows how to export ResultSet to Excel in Java.


The screen shot below provides an example of exported data to Excel file from a ResultSet.

Exported data to Excel file from ResultSet

Formatting cells

EasyXLS™ enables you to format cells, rows and columns in order to set the fonts and colors.

Export ResultSet to XLSX, XLSB, XLSM and XLS files

This code sample shows how to export a ResultSet to XLSX file. Similarly, you can export a ResultSet to XLS file using ExcelDocument.easy_WriteXLSFile_FromResultSet method or export ResultSet to XLSB file using ExcelDocument.easy_WriteXLSBFile_FromResultSet method.

Export ResultSet to Excel file with multiple sheets

For an Excel file having multiple sheets, the ResultSet can be inserted using ExcelWorksheet.easy_insertResultSet method and the Excel file must be exported using ExcelDocument.easy_WriteXLSXFile method.

Getting started with EasyXLS Excel library

To download the trial version of EasyXLS Excel Library, press the below button:

Download EasyXLS™ Excel Library for Java

If you already own a license key, you may login and download EasyXLS from your account.

After installation, you will need to create a Java project and add EasyXLS.jar to external libraries.

Available for: Professional, Excel Writer, Express Excel Writer
Go to top

EasyXLS Excel libraries:

Java Excel Library
full Java version to import, export or convert Excel files
Java Excel Writer
Java version to create and export Excel files
Java Express Excel Writer
limited Java version to create and export Excel files in predefined formats
Download EasyXLS™ Excel Library for Java

File formats:

MS Excel 97 - 2003
MS Excel 2007 - 2019
MS Excel 2021
Office 365