Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Cobol v5.0
  HXTT DBF v7.1
  HXTT Excel v6.1
  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 ACCESS
temporary ms access file cannot be deleted
Mdurovic
2008-06-26 20:37:18
Hi,

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 (rs.next())
{
System.out.println(rs.getString(1));
}
rs.close();
conn.close();
// 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?

Cheers,
Mdurovic
Re:temporary ms access file cannot be deleted
HXTT Support
2008-06-26 21:13:04
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
aa
2008-06-26 21:23:08
yes, it fixed it. Thanks.

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