public String getString(String columnName) throws SQLException { return getString(findColumn(columnName)); }
public String getFixedString(int col) throws SQLException String s = getString(col); if (s == null) return null;
public boolean getBoolean(int columnIndex) throws SQLException { checkResultSet(columnIndex); if (wasNullFlag) return false; // SQL NULL return toBoolean( getString(columnIndex) ); }
public java.sql.Date getDate(int i, java.util.Calendar cal) throws SQLException { checkResultSet(i); if (wasNullFlag) return null; if (cal != null) cal = (Calendar)cal.clone(); return connection.getTimestampUtils().toDate(cal, getString(i)); }
public Timestamp getTimestamp(int i, java.util.Calendar cal) throws SQLException { checkResultSet(i); if (wasNullFlag) return null; if (cal != null) cal = (Calendar)cal.clone(); // If this is actually a timestamptz, the server-provided timezone will override // the one we pass in, which is the desired behaviour. Otherwise, we'll // interpret the timezone-less value in the provided timezone. return connection.getTimestampUtils().toTimestamp(cal, getString(i)); }
public Time getTime(int i, java.util.Calendar cal) throws SQLException { checkResultSet(i); if (wasNullFlag) return null; if (cal != null) cal = (Calendar)cal.clone(); return connection.getTimestampUtils().toTime(cal, getString(i)); }
return 0; // SQL NULL String s = getString(columnIndex);
public InputStream getAsciiStream(int columnIndex) throws SQLException { checkResultSet( columnIndex ); if (wasNullFlag) return null; if (connection.haveMinimumCompatibleVersion("7.2")) { //Version 7.2 supports AsciiStream for all the PG text types //As the spec/javadoc for this method indicate this is to be used for //large text values (i.e. LONGVARCHAR) PG doesn't have a separate //long string datatype, but with toast the text datatype is capable of //handling very large values. Thus the implementation ends up calling //getString() since there is no current way to stream the value from the server try { return new ByteArrayInputStream(getString(columnIndex).getBytes("ASCII")); } catch (UnsupportedEncodingException l_uee) { throw new PSQLException(GT.tr("The JVM claims not to support the encoding: {0}","ASCII"), PSQLState.UNEXPECTED_ERROR, l_uee); } } else { // In 7.1 Handle as BLOBS so return the LargeObject input stream return getBinaryStream(columnIndex); } }
public InputStream getUnicodeStream(int columnIndex) throws SQLException { checkResultSet( columnIndex ); if (wasNullFlag) return null; if (connection.haveMinimumCompatibleVersion("7.2")) { //Version 7.2 supports AsciiStream for all the PG text types //As the spec/javadoc for this method indicate this is to be used for //large text values (i.e. LONGVARCHAR) PG doesn't have a separate //long string datatype, but with toast the text datatype is capable of //handling very large values. Thus the implementation ends up calling //getString() since there is no current way to stream the value from the server try { return new ByteArrayInputStream(getString(columnIndex).getBytes("UTF-8")); } catch (UnsupportedEncodingException l_uee) { throw new PSQLException(GT.tr("The JVM claims not to support the encoding: {0}","UTF-8"), PSQLState.UNEXPECTED_ERROR, l_uee); } } else { // In 7.1 Handle as BLOBS so return the LargeObject input stream return getBinaryStream(columnIndex); } }
public Object getObject(int columnIndex) throws SQLException { Field field; checkResultSet(columnIndex); if (wasNullFlag) return null; field = fields[columnIndex - 1]; // some fields can be null, mainly from those returned by MetaData methods if (field == null) { wasNullFlag = true; return null; } Object result = internalGetObject(columnIndex, field); if (result != null) return result; return connection.getObject(getPGType(columnIndex), getString(columnIndex)); }
public java.io.Reader getCharacterStream(int i) throws SQLException { checkResultSet( i ); if (wasNullFlag) return null; if (((AbstractJdbc2Connection) connection).haveMinimumCompatibleVersion("7.2")) { //Version 7.2 supports AsciiStream for all the PG text types //As the spec/javadoc for this method indicate this is to be used for //large text values (i.e. LONGVARCHAR) PG doesn't have a separate //long string datatype, but with toast the text datatype is capable of //handling very large values. Thus the implementation ends up calling //getString() since there is no current way to stream the value from the server return new CharArrayReader(getString(i).toCharArray()); } else { // In 7.1 Handle as BLOBS so return the LargeObject input stream Encoding encoding = connection.getEncoding(); InputStream input = getBinaryStream(i); try { return encoding.getDecodingReader(input); } catch (IOException ioe) { throw new PSQLException(GT.tr("Unexpected error while decoding character data from a large object."), PSQLState.UNEXPECTED_ERROR, ioe); } } }
public String getString(String columnName) throws SQLException { return getString(findColumn(columnName)); }
public boolean getBoolean(int columnIndex) throws SQLException { checkResultSet(columnIndex); if (wasNullFlag) return false; // SQL NULL return toBoolean( getString(columnIndex) ); }
public boolean getBoolean(int columnIndex) throws SQLException { checkResultSet(columnIndex); if (wasNullFlag) return false; // SQL NULL return toBoolean( getString(columnIndex) ); }
public java.sql.Date getDate(int i, java.util.Calendar cal) throws SQLException { checkResultSet(i); if (wasNullFlag) return null; if (cal != null) cal = (Calendar)cal.clone(); return connection.getTimestampUtils().toDate(cal, getString(i)); }
public java.sql.Date getDate(int i, java.util.Calendar cal) throws SQLException { checkResultSet(i); if (wasNullFlag) return null; if (cal != null) cal = (Calendar)cal.clone(); return connection.getTimestampUtils().toDate(cal, getString(i)); }
public Time getTime(int i, java.util.Calendar cal) throws SQLException { checkResultSet(i); if (wasNullFlag) return null; if (cal != null) cal = (Calendar)cal.clone(); return connection.getTimestampUtils().toTime(cal, getString(i)); }
public Timestamp getTimestamp(int i, java.util.Calendar cal) throws SQLException { checkResultSet(i); if (wasNullFlag) return null; if (cal != null) cal = (Calendar)cal.clone(); // If this is actually a timestamptz, the server-provided timezone will override // the one we pass in, which is the desired behaviour. Otherwise, we'll // interpret the timezone-less value in the provided timezone. return connection.getTimestampUtils().toTimestamp(cal, getString(i)); }
public Timestamp getTimestamp(int i, java.util.Calendar cal) throws SQLException { checkResultSet(i); if (wasNullFlag) return null; if (cal != null) cal = (Calendar)cal.clone(); // If this is actually a timestamptz, the server-provided timezone will override // the one we pass in, which is the desired behaviour. Otherwise, we'll // interpret the timezone-less value in the provided timezone. return connection.getTimestampUtils().toTimestamp(cal, getString(i)); }