Here you can find the source of convertToString(Object obj)
public static String convertToString(Object obj)
//package com.java2s; import java.sql.Clob; import java.sql.SQLException; public class Main { public static String convertToString(Object obj) { String value = ""; try {// w w w . j av a 2 s . c o m if (obj instanceof Clob) { value = ((Clob) obj).getSubString(1, (int) ((Clob) obj).length()); } else { value = String.valueOf(obj); } return value; } catch (SQLException | ClassCastException e) { e.printStackTrace(); return null; } } }