Here you can find the source of readStringFromBlob(ResultSet resultSet, String columnLabel)
public static String readStringFromBlob(ResultSet resultSet, String columnLabel)
//package com.java2s; //License from project: Apache License import java.nio.charset.StandardCharsets; import java.sql.Blob; import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static String readStringFromBlob(ResultSet resultSet, String columnLabel) { try {//from ww w . j a v a 2s . co m Blob factoryBlob = resultSet.getBlob(columnLabel); return new String(factoryBlob.getBytes(1L, (int) factoryBlob.length()), StandardCharsets.UTF_8); } catch (SQLException e) { throw new RuntimeException(e); } } }