• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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)
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!