Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing Spreadsheets

Status
Not open for further replies.

harryodave

Programmer
Feb 1, 2006
2
IE
Hi,

Does anyone have an idea of how to import a .xls spreadsheet into a mySQL server using JSP?

cheers,

Dave
 
Is the .xls on the server on which mysql is running or is it on some remote client somewhere ?

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
It is on the server, I am sure there is a command that I can use, not sure which one it is.
 
You will have to :

Load the image into a byte[] array using FileInputStream class.
Create a table in MySQL which has a BLOB field to hold the binary data whihch is the spreadsheet.
Use JDBC and the PreparedStatement class, and the setBytes() method (or maybe setBlob() if there are size constraints on setBytes()) to insert the binary data into the database.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
I don't mean an image, I mean the spreadsheet itself ! Must be losing it.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top