Code example for Statement

Methods: executeUpdategetGeneratedKeys

0
    protected int executeCommand(Statement statement) throws SQLException {
        return executeInsertCommand(statement);
    } 
 
    private int executeInsertCommand(Statement statement) throws SQLException {
        statement.executeUpdate(sqlStatement.getSql(), Statement.RETURN_GENERATED_KEYS);
        ResultSet generatedKeys = statement.getGeneratedKeys();
        if (generatedKeys.next()) {
            return generatedKeys.getInt(1);
        } else { 
            throw new MeltOrmException("Creating failed, no generated key obtained."); 
        } 
    } 
} 
Connect your IDE to all the code out there  Get Codota for Java