Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
  HXTT Cobol v5.0
  HXTT DBF v7.1
  HXTT Excel v6.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Json v1.0
  HXTT Paradox v7.1
  HXTT PDF v2.0
  HXTT Text(CSV) v7.1
  HXTT Word v1.1
  HXTT XML v4.0
Offshore Outsourcing
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT Excel
Update is not working.........
rama
2007-10-02 06:00:10
Hi All,
i am updating excel file using update statement.the query executed fine but the excel file is not updated.here i am attaching the code.

Class.forName("com.hxtt.sql.excel.ExcelDriver").newInstance();
Workbook workbook1 = new Workbook();
workbook1.open("e:\\reportadd.xls");
String url="jdbc:excel:////"+"e:\\reportadd.xls";
con = DriverManager.getConnection(url, "", "");
stmnt = con.createStatement();
String query = " update sheet1 set Status=1 where TrackId='"+tid+"' and Publisher='"+pub+"' ";
int i = stmnt.executeUpdate( query );
stmnt.close();
con.close();

statement is executing but the changes are not updated in the excel file.
please help me to solve the problem.

regards,
Rama.
Re:Update is not working.........
HXTT Support
2007-10-02 07:42:58
>int i = stmnt.executeUpdate( query );
You should print i value, if i>0, there shoud be i updated rows.
Re:Re:Update is not working.........
Rama
2007-10-02 21:04:07
Hi all,
Thanks for your response. I printed i value i am getting i value greater than 0(that is 1) but even one row is also not updating. please help me how i can resolve it.

Thnaks in advance.

Regards,
Rama.
Re:Re:Re:Update is not working.........
HXTT Support
2007-10-02 23:12:19
>Workbook workbook1 = new Workbook();
>workbook1.open("e:\\reportadd.xls");
What're these code?
Re:Re:Re:Re:Update is not working.........
rama
2007-10-03 01:33:10
hi all,

Thanks for your response. This code is to open an excel file.I am updating the column of that file(e:\\reportadd.xls")

thanks in advance.

Regards,
Rama
Re:Re:Re:Re:Re:Update is not working.........
HXTT Support
2007-10-03 02:26:24
>but the excel file is not updated.
How can you know that excel file hasn't been updated. Your Workbook shouldn't see those modifications. If you query through HXTT Excel JDBC driver again, you can see those modifications. If you wish to see those modifications at once after close connection, you need to set delayedClose=-1 connection property.
Re:Re:Re:Re:Re:Re:Update is not working.........
Rama
2007-10-03 22:39:46
HI ALL,

Thanks for your response.please help me how i can set that property delayedClose=-1. I have seen the connection class there is no such property available. please help me how i can do this.

Thanks in advance.

Regards,
Rama
Re:Re:Re:Re:Re:Re:Re:Update is not working.........
HXTT Support
2007-10-04 04:37:25
1st method:
String url="jdbc:excel:////"+"e:\\reportadd.xls?delayedClose=-1 ";
con = DriverManager.getConnection(url, "", "");

2nd method:
String url="jdbc:excel:////"+"e:\\reportadd.xls";
Properties properties=new Properties();
properties.setProperty("delayedClose","-1");
con = DriverManager.getConnection(url, properties);

Search Key   Search by Last 50 Questions




Google
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Refund | Sitemap