Here you can find the source of getGeneratedIdFromResultSet(ResultSet resultSet)
public static long getGeneratedIdFromResultSet(ResultSet resultSet) throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static long getGeneratedIdFromResultSet(ResultSet resultSet) throws SQLException { long orderId = -1; while (resultSet != null && resultSet.next()) { orderId = resultSet.getLong(1); }/*from w w w . j a v a2s . c om*/ return orderId; } }