0

hi i am having one excel file which contains 15 columns and having 5000 recordes. Now entering 5000 records manually into database is really a tough one. instead i want to create a small java application which get input as excel file and just by clicking upload to database button it should be uploaded to DB.

any ideas? is there any jar? please anybody guide me with example

2
  • 2
    Can't help you with an example. But, can tell you that you could use POI library to read XLS and process every row. poi.apache.org/spreadsheet/index.html Commented Apr 20, 2011 at 3:17
  • 2
    maybe you need to use the right tool for the job. Most databases come with an upload utility. Commented Apr 20, 2011 at 4:13

2 Answers 2

1

You need a excel parser. The popular one is POI Spreadsheet. Another one is JExcelAPI.

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

Comments

1

If you're using MySQL you'll probably want to look at this: Import Excel Data into MySQL in 5 Easy Steps.

Otherwise checkout the Java Excel API or Apache POI to parse an Excel document. Then iterate over the cells and insert them into your database. See Getting Started with JDBC if you're not familiar with writing to a database. Search around online as well, there are all sorts of libraries and examples out there.

Without more details about what you're doing it's hard to make more than these general suggestions.

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.