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
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
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Sitemap