Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  Buy Now
  HXTT Cobol v2.1
  HXTT DBF v5.2
  HXTT Excel v4.2
  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)

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


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