Upload excel file and then send data in excel file to database oracle using zk framework

asked 2020-04-09 15:09:25 +0800

FahmiIrmansyah gravatar image FahmiIrmansyah

I want to send data to database from selected excel file by using zk framework. The send button is using to send data from uploaded excel file to data base . Can you give me guide step by step ?

delete flag offensive retag edit

2 Replies

Sort by » oldest newest

answered 2020-04-10 10:27:28 +0800

jeanher gravatar image jeanher
1814 2 6
ZK Team

This can be done using the ZK-compatible Keikai Spreadsheet component. This tutorial shows how it can be done.

link publish delete flag offensive edit

answered 2020-04-14 11:59:52 +0800

cor3000 gravatar image cor3000
5868 2 7
ZK Team

updated 2020-04-14 12:07:46 +0800

I'll try to go into each aspect of your question:

DB: ZK doesn't include/prefer any database layer -> which means you have to choose yourself a library/framework to access your database and store the data, e.g. JDBC, hibernate, JPA, spring-data ... (that's outside the scope of ZK).

File Upload: In order to upload a file from a zul page you can use a file upload button:

<button upload="true" label="Import"/>

Then register an onUpload event listener, to handle the uploaded file contents. Retrieved from UploadEvent.getMedia().getByteData() / .getStreamData()

Extract Data from Excel File: Once you have the binary data, you need to process/parse it (e.g. using the apache POI library), which then allows you to access specific sheets/regions to extract data. Then use your persistence library from above to store the data into tables as needed.

If you need a manual approach for the user to select which data range to export you can use Keikai to import/display the spreadsheet to the user, let him/her select a region before storing it to a DB (as mentioned by @jeanher)

(Note: Keikai requires at least ZK 8.0.5 so you'd have to upgrade your older zk version

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2020-04-09 15:09:25 +0800

Seen: 6 times

Last updated: Apr 14 '20

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More