wood burning stoves*
The moose likes JDBC and the fly likes import excel data into mysql database? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "import excel data into mysql database?" Watch "import excel data into mysql database?" New topic
Author

import excel data into mysql database?

saravanan rajendran
Ranch Hand

Joined: Jun 13, 2008
Posts: 75
Hello,
I am hardly trying to import excel data into mysql database using servlet.
My first doubt is it possible to do it java.how?
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Wrong tool. If you save it as a tab-delimited file, you can force feed the data into MySql tables.
saravanan rajendran
Ranch Hand

Joined: Jun 13, 2008
Posts: 75
hi, thanks for yr replay.my excel sheet contain name,dob,age values i want to insert those value into mysql database in particular table how possible?
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

1) create table
2) save as tab-delimited file
3) import data
saravanan rajendran
Ranch Hand

Joined: Jun 13, 2008
Posts: 75
hi, thanks for yr replay i have jsp page that contain browser button when i pressed that button particular excel file is selected and i have import button when i pressed that all values have to store particular table in mysql database.how to do please help me
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

The word is "reply", not "replay".

Your problem is far from clear. Are you selecting this file from the client? If so, you will need to upload it to your server. That isn't a JDBC problem, but file uploading has been discussed many times in the Servlets and JSP forum.

Next, if these are really Excel files and you can't get tab-delimited or comma-delimited files, you'll need some code that can read them successfully. Apache POI or JExcel are two possibilities. Likewise this isn't anything to do with JDBC.

Finally, once you get the data out of the Excel format you will have to write it into your database. This requires understanding the data that is being transferred, including how it is stored in the Excel file and what tables and columns it must be put into in the database.

So yes, it's possible to do that in a servlet.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: import excel data into mysql database?