This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes JDBC and MS Excel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC and MS Excel" Watch "JDBC and MS Excel" New topic
Author

JDBC and MS Excel

Nikhil Raste
Greenhorn

Joined: Dec 02, 2003
Posts: 1
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

Joined: May 22, 2003
Posts: 108
can you give a little more information regarding the exception?


SCJP 1.2, SCJP 5, SCBCD
 
Consider Paul's rocket mass heater.
 
subject: JDBC and MS Excel
 
It's not a secret anymore!