Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access 7.1.202
  Buy Now
  HXTT Cobol 5.0.202
  HXTT DBF 7.1.203
  HXTT Excel 6.1.206
  HXTT Json 1.0.174
  HXTT Paradox 7.1.202
  HXTT PDF 2.0.202
  HXTT Text(CSV) 7.1.202
  HXTT Word 1.1.202
  HXTT XML 4.0.203
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)

temporary ms access file cannot be deleted
2008-06-26 20:37:18.0

I'm evaluating your HXTT Access package and I have a problem. The test I'm doing is the following:

1) I create, from within a Java program, a temporary database file, by copying from the original.

2) I load your driver and read a table from the database. This works, ie. your JDBC driver can read this database without problems.

3) then I try to delete the database file, AFTER closing the recordset and the connection. It fails.

If I comment out the code where I create the connection to the database via your driver (see below, between "Start using JDBC" and "end using JDBC") , deletion works fine. So, it's your driver that's locking it somehow.

The code goes like this:

File temp = File.createTempFile( "mytemp", ".mdb" );
... // copy from another location
// Start using JDBC
Class.forName( "com.hxtt.sql.access.AccessDriver" ).newInstance();
Connection conn = DriverManager.getConnection( "jdbc:access:///" +
temp.getAbsolutePath().replaceAll( "\\\\", "/" ) );
Statement command = conn.createStatement();
ResultSet rs = command.executeQuery( "select * FROM mytable" );
while (
// end using JDBC
if( !temp.delete() ) // don't need it any more
log.error( "Failed to delete: " + temp.getAbsolutePath() );

So, what can I do about it?

Re:temporary ms access file cannot be deleted
HXTT Support
2008-06-26 21:13:04.0
You can use delayedClose=0 connection property.
delayedClose: Indicates the delayed seconds for close transaction. That option is used to avoid frequent close/open table operations for following sqls. You can use 0~120 seconds. Default: 3.
Re:Re:temporary ms access file cannot be deleted
2008-06-26 21:23:08.0
yes, it fixed it. Thanks.

Search Key   Search by Last 50 Questions


Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Sitemap