How to update,insert and exact data from an exceed yellow journalism 1) Class.forName(sun.jdbc.odbc.JdbcOdbc driver); This statement is the sign feel for the directection 2) conn=device driverManager.getConnection(jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=C:/coffee/Book1.xls;ReadOnly=0;); This statement create the connection----jdbc:odbc:Driver = (name you get from understand panel ( Administrative tools( Data Sources In that data inauguration you have to connect your exceed sheet first. DBQ:path of the go by fiel or location ReadOnly = 0make file can be read,write,update 3) sql=insert into [Sheet1$] Values(1,2,3); in a higher place is the insert statement used to isert rows into the excel sheet 4) sql=select * from [Sheet1$]; Fetching the data into the chocolate program 5) stmt.executeUpdate(sql); (for insert or update into the excel sheet 6) rs=stmt.execu teQuery(sql); (for fetching the data impress excel sheet The following is the program /* * To change this template, aim Tools | Templates * and open the template in the editor. */ package newpackage; import java.sql.*; public class myJDBC { placid { test { Class.forName(sun.jdbc.odbc.JdbcOdbcDriver); } visualize (Exception e) { System.err.println(e); } } public static void main(String args[]) { Connection conn= goose egg; instruction stmt=null; String sql=; ResultSet rs=null; int ch = 0; try { conn=DriverManager.getConnection(jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=C:/java/Book1.xls;ReadOnly=0;); stmt=conn.createStatement(); sql=insert into [Sheet1$] V alues(1,2,3); stmt.execut! eUpdate(sql); sql=select * from [Sheet1$]; rs=stmt.executeQuery(sql);...If you want to get a in effect(p) essay, order it on our website: OrderCustomPaper.com
If you want to get a full essay, visit our page: write my paper
No comments:
Post a Comment