jQuery in Action, 2nd edition*
The moose likes JDBC and the fly likes Inserting data into Mysql from excel files using jdbc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Inserting data into Mysql from excel files using jdbc" Watch "Inserting data into Mysql from excel files using jdbc" New topic
Author

Inserting data into Mysql from excel files using jdbc

nick sharma
Greenhorn

Joined: May 05, 2008
Posts: 28
Hi

I recently developed an application using Servlets and JSP. The data for the application is supposed to be updated into Mysql through a batch file or excel file.how do i go about dumping data from excel to mysql using java or are there any tools available for it??

Regards
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You can access Excel with JDBC. You'll need to use the JDBC-ODBC bridge though. Other than that, Apache POI is the usual MS file format accessing tool.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3710
    
    5

If you want it put into MySQL server (instead of the bridge, which can be slow) you have to write your own JDBC conversion tool to perform the insert. Because Excel is a flat file and databases are generally highly structured, there's no magic tool to dump the file into the database. As Paul mentioned, the Apache POI API is a great tool to use in writing such a conversion tool.
[ July 14, 2008: Message edited by: Scott Selikoff ]

My Blog: Down Home Country Coding with Scott Selikoff
 
wood burning stoves
 
subject: Inserting data into Mysql from excel files using jdbc