Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Generating Insert Script from Excel sheet  RSS feed

 
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
I am having a excel workbook which has n number of worksheet.
Each worksheet has m number of columns and certain number of rows.

Here each worksheet represent a Table and each sheet has the entries which represent the data for the tables.

Now i need to write a java class to create a insert script for each and every table.

How can i do this using java or is there anyother easy way to generate sql script from the given excel sheet.


Thanks
Param
 
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, what parts are you comfortable with and what gives you trouble? Reading data from Excel, building the SQL statement, writing the SQL statement to a script, something else?

It is possible to treat Excel as a database with the JDBC ODBC Bridge but Sun says The JDBC-ODBC Bridge driver is recommended only for experimental use or when no other alternative is available. The POI library is another option to read Excel.

Do you have some "almost working" code?
 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No i am yet at design stage.

I am looking for the possible way in which one can do it.
I heard abt jxl.* package and just want to choose the best option.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!