![JAR search and dependency download from the Maven repository](/logo.png)
org.knowm.yank.handlers.InsertedIDResultSetHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yank Show documentation
Show all versions of yank Show documentation
Ultra-Light JDBC Persistance Layer for Java Apps
package org.knowm.yank.handlers;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.apache.commons.dbutils.ResultSetHandler;
/**
* This gets the long value representing the auto-assigned primary key id from the ResultSet object
* generated from inserting a row.
*
* @author timmolter
*/
public class InsertedIDResultSetHandler implements ResultSetHandler {
public Long handle(ResultSet rs) throws SQLException {
if (rs.next()) {
return rs.getLong(1);
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy