Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.Cells can import data into worksheets from a ResultSet object which can be created from any database. However, this article specifically creates a ResultSet object from a Microsoft Access database. Since the code is the same for all types of databases, you can use it in general.
Please download UCanAccess. It includes the following JAR files. Add all of them to the classpath.
For more help, please visit this Stack Overflow link.
The following sample Microsoft Access 2016 database file was used in the sample code. You can use any database file or create your own.
The following screenshot shows the database file when opened in Microsoft Access 2016.

The following sample code executes an SQL query from a Microsoft Access database and creates a ResultSet object. Then it imports data from the ResultSet object into the worksheet using the Worksheet.getCells().importResultSet() method. The first time, it uses row and column indices, and then it uses a cell name to import data into the worksheet. Finally, it saves the workbook as an output Excel file. The screenshot shows the result of the sample code on the output Excel file for reference.

Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.