getLastAutoIncrementKey

DataObject sqlDataManager.getLastAutoIncrementKey (String table) (professional and enterprise editions only)

Description

Retrieve the last autogenerated primary key, if any, for the given table

Parameters

case insensitve table name

Return Values

Returns a com.screenscraper.datamanager.DataObject containing the primary key.

Change Log

Version Description
5.0 Available for professional and enterprise editions.

Examples

Retrieve AutoIncrement Key

 //Save some data
 dm.addData("table", "column", "important data");
 dm.commit("table");
 dm.flush("table");

 //Retrieve the key associated with the data we just saved as an Integer
 key = dm.getLastAutoIncrementKey("table").getInt();