Java SQL ResultSet String Read getString(ResultSet rs, int index, boolean trim)

Here you can find the source of getString(ResultSet rs, int index, boolean trim)

Description

get String

License

Open Source License

Declaration

public static String getString(ResultSet rs, int index, boolean trim) throws java.sql.SQLException 

Method Source Code


//package com.java2s;
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt

import java.sql.ResultSet;

public class Main {
    public static String getString(ResultSet rs, int index, boolean trim) throws java.sql.SQLException {
        String result = rs.getString(index);
        if (trim && result != null) {
            return result.trim();
        }/*  w w w. jav a  2  s.  c  o  m*/
        return result;
    }
}

Related

  1. getString(ResultSet p_rset, int p_col)
  2. getString(ResultSet res, String name)
  3. getString(ResultSet resultSet, String columnName)
  4. getString(ResultSet resultSet, String columnName)
  5. getString(ResultSet rs, int ix, int sql_type)
  6. getString(ResultSet rs, String column)
  7. getString(ResultSet rs, String columnLabel)
  8. getString(ResultSet rs, String columnName)