Here you can find the source of getEnum(Class
public static <E extends Enum<E>> E getEnum(Class<E> enumClass, ResultSet rs, String columnName) throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static <E extends Enum<E>> E getEnum(Class<E> enumClass, ResultSet rs, String columnName) throws SQLException { String value = rs.getString(columnName); if (value == null) { return null; } else {/*from ww w. j av a 2s . c o m*/ return Enum.valueOf(enumClass, value); } } }