Here you can find the source of getStringUTF8(ResultSet rs, String which)
public static String getStringUTF8(ResultSet rs, String which) throws SQLException
//package com.java2s; import java.io.UnsupportedEncodingException; import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static boolean db_Derby = false; public static String getStringUTF8(ResultSet rs, String which) throws SQLException { if (db_Derby) { // unicode String str = rs.getString(which); if (rs.wasNull()) return null; return str; }// w ww . ja v a2 s . c o m byte rv[] = rs.getBytes(which); if (rs.wasNull()) return null; if (rv != null) { String unicode; try { unicode = new String(rv, "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); throw new InternalError(e.toString()); } return unicode; } else { return null; } } public static final String getStringUTF8(ResultSet rs, int which) throws SQLException { if (db_Derby) { // unicode String str = rs.getString(which); if (rs.wasNull()) return null; return str; } byte rv[] = rs.getBytes(which); if (rs.wasNull()) return null; if (rv != null) { String unicode; try { unicode = new String(rv, "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); throw new InternalError(e.toString()); } return unicode; } else { return null; } } }