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

HXTT DBF
can not perform insert into table1 as select * from table2
insankamil
2005-07-12 00:00:00.0
below i post my code :

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

public class backofficeDbfVerification {

public backofficeDbfVerification(String path) throws SQLException {
Properties prop = new Properties();
prop.setProperty("user", "");
prop.setProperty("OtherExtensions","true");
prop.setProperty("Version Number", "03");
try {
Class.forName("com.hxtt.sql.dbf.DBFDriver").newInstance();
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 !");
}
catch(Exception e) {
System.out.println(e.getMessage());
}
}

public void createBadRecord(String table, String newtable, int blth) throws SQLException {
Statement stmt = connection.createStatement();
String insert = "insert into \""+newtable+"\" select * from \""+table+"\"";
boolean bInsert = stmt.execute(insert);
stmt.close();
}

public static void main (String args[]) {
String path = "C:\\MASTER\\SOURCEDATA\\AREA";
try {
backofficeDbfVerification test = new backofficeDbfVerification(path);
test.createBadRecord("source\\area\\123.AA2","source\\area\\others\\89964568.AA1");
}
catch(SQLException sqx) {
System.out.println("Error "+sqx.getMessage());
}
}
}

i try to perform simple query : insert into tablea select from tableb which has same structure. the source table has only 9 rows, but the process ran very long time, no error message raised,it just run and never end (which make me upset for the whole day).

is it becoz of function limitation since i used evaluation copy ?
Re:can not perform insert into table1 as select * from table2
HXTT Support
2005-07-13 00:00:00.0
No function limitation. I just tested:
create table testa1 select * from test;
insert into testa1 select * from test;

Passed.

I also run your backofficeDbfVerification.java sample. Passed too. I'm using the same code as you. The difference is only my 89964568.AA1 and 123.AA2 is simulative tables files. If possible, please zip your 89964568.AA1 and 123.AA2 and email to webmaster@hxtt.com. Thanks.

BTW, I pasted the little modified backofficeDbfVerification.java below:
import java.sql.*;
import java.util.*;

public class backofficeDbfVerification {
Connection connection;

public backofficeDbfVerification(String path) throws SQLException {
Properties prop = new Properties();
prop.setProperty("user", "");
prop.setProperty("OtherExtensions", "true");
prop.setProperty("Version Number", "03");
try {
Class.forName("com.hxtt.sql.dbf.DBFDriver").newInstance();
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 !");
}
catch (Exception e) {
System.out.println(e.getMessage());
}
}

public void createBadRecord(String table, String newtable) throws
SQLException {
Statement stmt = connection.createStatement();
String insert = "insert into \"" + newtable + "\" select * from \"" +
table + "\"";
boolean bInsert = stmt.execute(insert);
stmt.close();
}

public static void main(String args[]) {
String path = "f:\\dbffiles";
try {
backofficeDbfVerification test = new backofficeDbfVerification(path);
test.createBadRecord("source\\area\\123.AA2",
"source\\area\\others\\89964568.AA1");
}
catch (SQLException sqx) {
System.out.println("Error " + sqx.getMessage());
}
}
}





Search Key   Search by Last 50 Questions




Google
 

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