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
Last Insert
Yao GBEKOU
2007-06-27 05:24:32.0
I am using HXTT DBF v3.1 and I want to get the last_Insert autoincrement primary key from a table in a transaction that is not end yet. It is possible in MySQL. So I would like to ask if it is possible with your driver or Foxpro. If yes how I can do it.
My database is in Foxpro 8
Re:Last Insert
HXTT Support
2007-06-27 05:48:07.0
First, you need have an AUTO_INCREMENTcolumn.
Secondly, you should use Statement.RETURN_GENERATED_KEYS. For instance,
stmt.executeUpdate("insertsql;",Statement.RETURN_GENERATED_KEYS);
ResultSet rs=stmt.getGeneratedKeys();
rs.next();
System.out.println("The id for inserted row is "+rs.getObject(1));
Re:Re:Last Insert
Yao GBEKOU
2007-06-27 06:18:50.0
What is insertsql? Is it the SQL statement I am going to insert in the table?
Re:Re:Re:Last Insert
HXTT Support
2007-06-27 06:24:28.0
Yeah. But you should make sure there's an AUTO_INCREMENTcolumn in your table.

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