Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  HXTT Cobol v2.1
  HXTT DBF v5.2
  HXTT Excel v4.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
  HXTT XML v1.2
Offshore Outsourcing
Oracle Data Import/Export
DB2 Data Import/Export
Sybase Data Import/Export
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
   
   
   
Hongxin Technology & Trade Ltd. of Xiangtan City (abbr, HXTT)

HXTT Excel
Update is not working.........
rama
2007-10-02 06:00:10.0
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.0
>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.0
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.0
>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.0
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.0
>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.0
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.0
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
 

Address: 9 Station Rd., Xiangtan City, Hunan Province, P.R. China
Postcode: 411100
Phone: (86)731-58225727
Fax: (86)731-58225727
Email: webmaster@hxtt.com
Copyright © 1999-2011 Hongxin Technology & Trade Ltd. | All Rights Reserved. | Privacy | Legal | Sitemap