Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC and MS Excel

 
Nikhil Raste
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am not able to insert values into an excel file using JDBC. I am attaching the code herewith;
import java.sql.*;
public class jdbctoexcel2
{
public static void main (String Args[])
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con = DriverManager.getConnection("jdbc dbc:excel");
Statement st = con.createStatement();
st.executeUpdate("insert into Sheet1$ values ('1','1')");



st.close();
con.close();
}
catch (Exception e) { System.out.println(e); }
}
}
Can anyone help me out with this??
 
Chris Brat
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you give a little more information regarding the exception?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic