Java SQL ResultSet Read getGeneratedIdFromResultSet(ResultSet resultSet)

Here you can find the source of getGeneratedIdFromResultSet(ResultSet resultSet)

Description

get Generated Id From Result Set

License

Open Source License

Declaration

public static long getGeneratedIdFromResultSet(ResultSet resultSet) throws SQLException 

Method Source Code

//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;
    }
}

Related

  1. getFieldNames(ResultSet rs)
  2. getFieldsPresentInResultSet(ResultSet rs)
  3. getFirstGeometryFieldIndex(ResultSet resultSet)
  4. getFirstInt(ResultSet resultSet)
  5. getFlags(ResultSet rs)
  6. getHashMap(ResultSet resultSet)
  7. getHeaders(ResultSetMetaData rsmd)
  8. getHighPrecisionString(ResultSet rs, int ix, int sql_type)
  9. getHtmlRows(ResultSet results)