• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reading Excel file Data and Storing in the Database

 
Ranch Hand
Posts: 42
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Ranchers,

In my application one of the tasks is storing the excel file data in to database. for this i am using POI api . but i want to validate the whole data of excel file whether it is correctly entered or not.
for this validation please give me some suggestions.


thanks and ragards
Ram.
 
Ranch Hand
Posts: 72
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
You can first check what is the type of cell, in case your excel sheet contains all different types of data. Then on the basis of the cell type, you can call your validation methods on that data.

you can even use data validation method provided by poi
check this:
http://www.roseindia.net/tutorials/poi/XLDataValidation.shtml
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
POI provides some API for validating the data in the excel sheet.
Please explore the API.
Hints : Explore the following API's DataValidation, HSSFDataValidation

Thanks
 
rambabu desina
Ranch Hand
Posts: 42
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

nir sharma wrote:hi,
You can first check what is the type of cell, in case your excel sheet contains all different types of data. Then on the basis of the cell type, you can call your validation methods on that data.



thanks for your reply.
but i want to restrict the user to upload the excel files, whose cells are fixed to some type. if user doesn't give the excel file with predefined cell types then we have to show some error message.
for this validation , what i have to do.

Regards,
Ram.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic