Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v6.0
  Buy Now
  HXTT Cobol v3.0
  HXTT DBF v6.0
  HXTT Excel v5.0
  HXTT Paradox v6.0
  HXTT Text(CSV) v6.0
  HXTT XML v2.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 Beijing 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 © 1999-2017 Heng Xing Tian Tai Lab of Beijing City. | All Rights Reserved. | Privacy | Legal | Sitemap