ResultSet getXXX methods

Поиск
Список
Период
Сортировка
От Joseph Shraibman
Тема ResultSet getXXX methods
Дата
Msg-id bkobpe$h84$1@news.hub.org
обсуждение исходный текст
Список pgsql-jdbc
Each getXXX() method in AbstractJdbc1ResultSet first calls getString(), which decodes the
bypte[] into a String, then operates on that String.  For example:

    public boolean getBoolean(int columnIndex) throws SQLException
    {
        return toBoolean( getString(columnIndex) );
    }
    public static boolean toBoolean(String s)
    {
        if (s != null)
        {
            int c = s.charAt(0);
            return ((c == 't') || (c == 'T') || (c == '1'));
        }
        return false;        // SQL NULL
    }

Is there any encoding there t, T, and the number chars are not the same?  I was under the
impression that all encodings are the same for bytes <= 127.  If there isn't then for
getBoolean() we can just get the first byte and compare it to t,T, and 1.


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Bjørn T Johansen
Дата:
Сообщение: Table Lock?
Следующее
От: Barry Lind
Дата:
Сообщение: Re: Table Lock?