File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes From MS EXCEL to the Database -- is it possible? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "From MS EXCEL to the Database -- is it possible?" Watch "From MS EXCEL to the Database -- is it possible?" New topic

From MS EXCEL to the Database -- is it possible?

Steven Sega

Joined: Jan 05, 2002
Posts: 6
1)I have done this easily: query an Oracle or whatever database and present the data in MS Excel format to the client.
ps. and we all know we can save this to hard disk as a flat file -- super duper easy program which we can write with our eyes closed.
2)This is my problem: from a client in MS Excel -- can the client save to the Oracle database?
Uuuh. My initial reaction to no.2 was -- that's impossible. Then I thought of asking people here at javaranch. If no. 2 is possible -- How can I do it?
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

I think you'll get more help on this in a forum that deals more with databases... So I'm moving it to the JDBC forum...


Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Kenneth Reising

Joined: Jul 30, 2001
Posts: 10
Some of the people where I work use the OraXcel ( product and been happy with it. It is reasonablly priced, but that is about the extend of my knowledge on it.
Else I'd imagine you could do some ODBC bridge into Oracle magic, (which is probably how you got Oracle into Excel).
You might also try poking around on Google some:
Paul Bailey
Ranch Hand

Joined: Oct 20, 2000
Posts: 91
Could you try to restate the problem?
I think you want the user to "save" an excel file and have information popup in your db instantly.
If there is only one client, make the excel file an ODBC database and go from there.
If there are many clients, things are more trickey, you might want to get a comercial package.
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

This may not be what you're after but I'll make a stab at it anyways:
Have the client save the excel spreadsheet as a *.csv file. Have a java program that takes a *.csv file as a parameter, read each line using file io, parse each column value using StringTokenizer, then write each line to the database.
I have tried using JDBC-ODBC, to read the excel files, then update the Oracle DB but I found that setting up every client to work was more pain that it was worth. besides, the file io method was a lot faster.
Another method is to invoke SQL Loader to import the file.
All the above methods have an extra step the user has to do before the data can be written to Oracle. So this may not suit you because you don't click save from Excel.
I agree. Here's the link:
subject: From MS EXCEL to the Database -- is it possible?
It's not a secret anymore!