Java SQL ResultSet Read getUUIDFromResultSet(ResultSet rset, String name)

Here you can find the source of getUUIDFromResultSet(ResultSet rset, String name)

Description

get UUID From Result Set

License

Open Source License

Declaration

public static UUID getUUIDFromResultSet(ResultSet rset, String name) throws SQLException 

Method Source Code

//package com.java2s;
/**//from  w  w  w . j a v a 2s .  c  o m
 Copyright (c) 2013, Amit Lieberman
All rights reserved.
    
           GNU LESSER GENERAL PUBLIC LICENSE
               Version 3, 29 June 2007
    
 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.
    
    
  This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License
    
 * Created with love
 * User: shpandrak
 * Date: 10/20/12
 * Time: 10:37
 */

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;

public class Main {
    public static UUID getUUIDFromResultSet(ResultSet rset, String name) throws SQLException {

        String val = rset.getString(name);
        if (val != null && !val.isEmpty())
            return UUID.fromString(rset.getString(name));
        return null;
    }
}

Related

  1. getRsCloumns(ResultSet rs)
  2. getRSData(ResultSet rs, String columnName, int jdbcType)
  3. getStatement(ResultSet resultSet)
  4. getURI(ResultSet resultSet, String columnLabel)
  5. getURI(ResultSet rs, int col)
  6. getValue(int type, ResultSet resultSet, int columnIndex)
  7. getValue(ResultSet result, String strField)
  8. getValue(ResultSet resultSet, String columnName, E defaultValue)
  9. getValue(ResultSet rs, String sField)