• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Generating Insert Script from Excel sheet

 
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sometimes you feel like a nut. Sometimes you feel like a tiny ad.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic