0

How to Import Data from Excel sheet to DB Table through Oracle ADF ? using Input file ?!

3
  • af:inputeFile will upload the file. You'll need another package to actually parse it, if that's your objective. Commented Jul 14, 2014 at 13:34
  • yes .. how to parse excel sheet data to DB ? Commented Jul 14, 2014 at 13:37
  • Posted as an answer, really not enough info in the question to give you anything more regarding the actual persistence to the DB. Just use JDBC? Commented Jul 14, 2014 at 14:01

4 Answers 4

1

To upload the file use standard implementation of:

<af:inputFile/>

For parsing the Excel file, there is no inherent java support, but I've used Apache POI in the past.

http://howtodoinjava.com/2013/06/19/readingwriting-excel-files-in-java-poi-tutorial/

Sign up to request clarification or add additional context in comments.

Comments

1

Thanks for answers ,

I solved the issue by using Apache POI to parse excel sheet to java objects

Steps :

  1. use <af:inputFile/> component in jsf or jspx page.
  2. in managed bean get the file inputstream from inputFile component.
  3. parse this excel file using Apache POI.
  4. inserted them to DB using AM in adf.

1 Comment

Thank you, this has helped me alot. Might I add some details for future users since I've spent a few days to do this. 1) download both poi and ooxml libraries and add them through tools - manage libraries, and project properties - libraries and classpath 1.5) Connect valuechanged from afinputfile to backing bean method 2) import libraries in your managed bean and parse to input stream 3) parse to hssf (or the other one) in a try catch block. 4) I'm still working on the forth step If anyone needs code example, I'll post it.
0

I would consider the use of Apache POI - which gives a java API to read MS Office VB Model. Then simply load the data into your VO(s) and commit.

Comments

0

if you can Saved excel file as .CSV format. (Without excel functions) then you can upload file in to system using inputfile component

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.