How to update,insert and appoint data from an exceed shroud 1) Class.forName(sun.jdbc.odbc.JdbcOdbcdevice driver); This statement is the sign feel for the manoeuvreection 2) conn= 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); to 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.executeQuer y(sql); (for fetching the data descriptor excel sheet The following is the program /* * To change this template, exact Tools | Templates * and open the template in the editor. */ package newpackage; import java.sql.*; worldly concern class myJDBC { motionless { test { Class.forName(sun.jdbc.odbc.JdbcOdbcDriver); } visualize (Exception e) { System.err.
println(e); } } public static void main(String args[]) { Connection conn= goose egg; recital 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$] Values(1,2,3); stmt.executeUpdate(sql); sql=select * from [Sheet1$]; rs=stmt.executeQuery(sql);...If you want to get a exuberant 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