GeeCON Prague 2014*
The moose likes JDBC and the fly likes How to insert data from file excel into DB? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to insert data from file excel into DB?" Watch "How to insert data from file excel into DB?" New topic
Author

How to insert data from file excel into DB?

blue sky
Greenhorn

Joined: Jul 20, 2003
Posts: 12
Hi all,
Could you please tell me how insert data from Excel file to database.
Example: my excel file include members information (username,pwd,email,fullname). My DB have table member. And I want insert list members from excel to DB
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"good luck",
It appears that you have changed your name from a valid display name to an invalid display name. Please change it back, accounts with invalid display names get deleted.
This is not a servlet question, I'm moving it to the JDBC forum.
Dave.
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1817

Well, you could create an ODBC driver to your Excel file and read and write data that way (using the JDBC-ODBC Bridge). Also, depending on the database, there may already be conversion utilities available (Access and SQL Server have such utils (them being M$), but I think other DBs do as well...)
[ November 19, 2003: Message edited by: Joel McNary ]

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

If possible, from excel save the file as a tab delimited text file. Read the file in, parse the data columns ( use reg. expressions if possible ) then write each line of data to your database. I do have delimited file reader class (for JDK 1.4) that can make this easier if you decide to go that route.
Jamie
Vladimir Ergovic
Ranch Hand

Joined: Apr 22, 2001
Posts: 63
You have framework to read Excell files on jakarta it is POI.


Vladimir Ergovic
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
export as csv, then import using sql-loader
 
jQuery in Action, 2nd edition
 
subject: How to insert data from file excel into DB?