Wednesday, March 28, 2001 04:45 AM
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 quirious 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
public class jdbcex
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