cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results for 
Search instead for 
Did you mean: 

Generate Excel for a SQL query

shubhamshah1412
New Contributor II

Greetings,
I am using a Java Spring boot application that is supposed to respond with an excel based on request. My current approach involves reading data using jdbc drivers, storing them in appropriate data structures, writing them to an excel which will be returned on the output stream.
Was curious to know if we have any provision to directly generate the excel for a given query using some API, libraries etc which I can return on the output stream.

3 REPLIES 3

Kaniz_Fatma
Community Manager
Community Manager

Hi @shubhamshah1412, Yes, some libraries can help you generate an Excel file directly from a query in a Spring Boot application. One such library is Apache POI123.

 

With this method, you can effortlessly produce and retrieve an Excel document from your Spring Boot endpoint. Include the essential dependencies for Apache POI in your project's build file.

 

I trust this information is beneficial to you! Don't hesitate to reach out if you require further assistance. 😊

shubhamshah1412
New Contributor II

Thanks for putting this together @Kaniz_Fatma ,
I see that this approach will help to generate an excel after receiving the data from data bricks in the form of resultSet which has to be parsed.
I believe this approach is the appropriate way to generate excel then.
Please correct my understanding if incorrect.

Kaniz_Fatma
Community Manager
Community Manager

Hi @shubhamshah1412, Yes, If you have any specific questions or need further clarification on implementing this approach, feel free to ask!

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!