Here you can find the source of safeGetString(ResultSet r, String name)
public static String safeGetString(ResultSet r, String name) throws SQLException
//package com.java2s; /******************************************************************************* * Copyright (c) 2003, 2014 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * /*w ww . jav a 2 s. c om*/ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static final String EMPTY = ""; public static String safeGetString(ResultSet r, String name) // throws SQLException { String s = r.getString(name); return (s != null) ? s : EMPTY; } }