This week's book giveaway is in the Other Open Source APIs forum. We're giving away four copies of Storm Applied and have Sean Allen, Peter Pathirana & Matthew Jankowski on-line! See this thread for details.
Check out java.sql.PreparedStatement, combined with a BLOB field in your database. Open an InputStream to the uploaded file, and call setBinaryStream with it.
There might be a problem with this if you don't know the file size and either your database driver is not built for Java 6, or you're stuck to Java 5.0 or below for some reason - you need to pass the InputStream length (as an int) to the only setBinaryStream method available in Java 5.0 and below.
I suspect he wanted to actually get the data in the Excel worksheet into rows in the database (I am assuming this from the query written). For that you should check up on using some third party framework e.g. Apache POI HSSF or ActiveXLS You can then read the data from the Excel sheets and then run them against the database using the query as necessary.