aspose file tools*
The moose likes Other Application Frameworks and the fly likes using ms excel as a database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "using ms excel as a database" Watch "using ms excel as a database" New topic

using ms excel as a database

j wu

Joined: May 25, 2005
Posts: 1
I am creating an online web voting web page. I have been informed that there is a java code that can be used to display data from an excel spreadsheet on a webpage. I have about 3000 rows of data and about 5 columns of data on the spreadsheet. I want to know how to use java to put all this information online. The reason for this is, I need to frequently change this excel spreadsheet annually and I do not want to hard code it in. Any suggestions will be useful, thank you.
Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
You probably want poi.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15292

You can also setup an ODBC connection to an Excel file and then just query ODBC much the same way as any other database.

GenRocket - Experts at Building Test Data
Prem Khan
Ranch Hand

Joined: May 30, 2005
Posts: 189
yeah id sujgest using the jdbc-odbc brigde. I even have the code ready for such a thing. It can make use of any ODBC DSN so create one first. This one makes use of a MS Access database, but you could make it work with excel. Dont know it excel can do SELECT statments. Excel is a pretty messed up tool to be useing for a DB.


String url = "jdbc dbc:CLIENTDB";
Connection conn = DriverManager.getConnection(url, "websysaccess", "mshobx");
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);

if (rows.size() > 0) {
StringBuffer sql = new StringBuffer("SELECT * FROM tblMemberAddress");
if (rows.size() == 1) {
sql.append(" WHERE MemberID = " + ((UserTblMemberAddress)rows.get(0)).getMemberId());
sql.append(" AND AddressID = '" + ((UserTblMemberAddress)rows.get(0)).getAddressId() + "'");
I agree. Here's the link:
subject: using ms excel as a database
Similar Threads
Parsing excel data - Urgent
Reading and Writing from Excel Spreadsheet
Need to create an ADMIN utility
Setting the column width of an Excel
how to retrieve the informations from database and publish into excel sheet/spread sheet