Here you can find the source of readString(final ResultSet resultSet, final String columnName)
Parameter | Description |
---|---|
resultSet | The result set to read from. |
columnName | Name of the column to read. |
Parameter | Description |
---|---|
SQLException | Thrown if the column could not be read. |
public static String readString(final ResultSet resultSet, final String columnName) throws SQLException
//package com.java2s; /*/*w w w . ja va2 s .co m*/ Copyright 2015 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ import java.sql.ResultSet; import java.sql.SQLException; public class Main { /** * Helper function that exists primarily to fool poedit to stop localizing column names. This * function simply reads a string from a result set. * * @param resultSet The result set to read from. * @param columnName Name of the column to read. * * @return The string value read from the given column. * * @throws SQLException Thrown if the column could not be read. */ public static String readString(final ResultSet resultSet, final String columnName) throws SQLException { return resultSet.getString(columnName); } }