Re: How to extract data to and from microsoft excel on to the browser ?
Monday, April 23, 2001 11:14 PM
Steps required for making connection to Excel workbook thro' JDBC program.
1> Make a DSN by selecting your workbook as a datasource(ofcourse through the Excel Driver)
2> Open the DSN
3> Your Excel sheet must have field names in the 1st row.
The most curious part is that what one should write in the SQL query.
and the answer is that one has to use the sheet name appended with a
for refernce here goes a small program
You can put this code in your Servlet or JSP
public class jdbcexcel
public static void main(String s)
Connection con =
DriverManager.getConnection("Jdbc:Odbc:sanjit","","");//'sanjit' is the name of my DSN
Statement st = con.createStatement();
int p = st.executeUpdate("insert into "sheet2$" values
('xyz','sanjit')");//data inserted in sheet2