Java SQL ResultSet String Read getStringSuppressSQLException(final ResultSet rs, final String columnLabel)

Here you can find the source of getStringSuppressSQLException(final ResultSet rs, final String columnLabel)

Description

Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language suppressing SQLException

License

Mozilla Public License

Parameter

Parameter Description
rs a parameter
columnLabel a parameter

Return

string value

Declaration

public static String getStringSuppressSQLException(final ResultSet rs, final String columnLabel) 

Method Source Code

//package com.java2s;
/**//from   w  w  w .  j a  va2s .  co m
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 */

import java.sql.ResultSet;
import java.sql.SQLException;

public class Main {
    /**
     * Retrieves the value of the designated column in the current row of this ResultSet object 
     * as a String in the Java programming language suppressing SQLException
     * 
     * @param rs
     * @param columnLabel
     * @return string value
     */
    public static String getStringSuppressSQLException(final ResultSet rs, final String columnLabel) {
        String columnValue = null;

        try {
            columnValue = rs.getString(columnLabel);

        } catch (SQLException ex) {
        }

        return columnValue;
    }
}

Related

  1. getString(ResultSet rs, String name)
  2. getString(ResultSet rs, String name, String ifnull)
  3. getStringChunks(ResultSet rs, int colIndex, StringBuffer buf)
  4. getStringFromResultSetEmptyIsNull(ResultSet rset, String fieldName)
  5. getStringList(ResultSet resultSet, String columnName)
  6. getStringUTF8(ResultSet rs, String which)
  7. getStringValue(final ResultSet rs, final int index)
  8. getTrimmedStringToUpperCase(ResultSet rs, String columnLabel)