Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
  HXTT Cobol v5.0
  HXTT DBF v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  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 DBF
can not delete record
insankamil
2005-07-11 00:00:00
below i post my code :

import java.util.*;
import java.sql.*;
import java.io.*;
import com.hxtt.sql.*;

public class backofficeDbfVerification {

Connection connection;
/** Creates a new instance of backofficeDbfVerification */
public backofficeDbfVerification(String path, Properties prop) throws SQLException {
try {
Class.forName("com.hxtt.sql.dbf.DBFDriver");
connection = DriverManager.getConnection("jdbc:DBF:/"+path, prop);
}
catch (ClassNotFoundException classnotfoundexception) {
System.out.println("could ot find HXTT class, make sure the classpath have been defined in your system !");
}
}

public void createGoodRecord(String table, int blth) throws SQLException {
Statement stmt = connection.createStatement();
String delete = "delete from '"+table+"' where VAL(substring(blth,3,4)+substring(blth,1,2)) < "+blth;
boolean bdelete = stmt.execute(delete);
stmt.close();
connection.commit();
}

public ResultSet querySomeData(String table) throws SQLException {
Statement stmt = connection.createStatement();
String query = "select * from '"+table+"' where VAL(substring(blth,3,4)+substring(blth,1,2)) < 200310";
ResultSet result = stmt.executeQuery(query);
return result;
}

public static void main (String args[]) {
Properties pp = new Properties();
pp.setProperty("user", "");
String path = "C:\\JATIM\\MLPOV2\\DKI\\temp\\SOREK";
String pathCopy = "C:\\JATIM\\MLPOV2\\DKI\\source\\SOREK";
try {
backofficeDbfVerification test = new backofficeDbfVerification(path, pp);
test.createGoodRecord("5462154", 200310);
}
catch(SQLException sqx) {
System.out.println("Error "+sqx.getMessage());
}
}

}

when i perform delete action, no record deleted form the file (the record still exist as i check the table using visual foxpro), but no record are retrieved too when i perform method querySomeData().

i really don't know what exactly happens, the record still exists after i deleted them, but norecords retrieved from query action....

please help...
Re:can not delete record
HXTT Support
2005-07-11 00:00:00
Because those rows are just marked with a DELETED flag according to Xbase stanadard, so that VFP can see those deleted rows. If you wish to remove those deleted rows permanently, you should use "PACK TABLE yourTable;" once.

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