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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to view Excel via JSP

Status
Not open for further replies.

duanduan

Programmer
Jan 19, 2007
1
CA
I am write a program that supports the online enquery of test marks where the database is using .xls file.

I have added test.xls to the data Source ODBC --> system DSN.

The code is as follows:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc dbc:test";
Connection connection =
java.sql.DriverManager.getConnection(url, "", "");

java.sql.Statement st=connection.createStatement();

String query = "SELECT * from [sheet1] ";

ResultSet rs = st.executeQuery(query);

connection.close();

It doesn't work. Any one can help me out?

The error information is display as:

java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:532)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at markquery._0002fmarkquery_0002fMarkRetriever_0002ejspMarkRetriever_js
p_10._jspService(_0002fmarkquery_0002fMarkRetriever_0002ejspMarkRetriever_jsp_10
.java:96)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top