Codota Logo
AbstractJdbc2ResultSet.getBinaryStream
Code IndexAdd Codota to your IDE (free)

How to use
getBinaryStream
method
in
org.postgresql.jdbc2.AbstractJdbc2ResultSet

Best Java code snippets using org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBinaryStream (Showing top 12 results out of 315)

  • Common ways to obtain AbstractJdbc2ResultSet
private void myMethod () {
AbstractJdbc2ResultSet a =
  • Codota IconPreparedStatement preparedStatement;(AbstractJdbc2ResultSet) preparedStatement.executeQuery()
  • Smart code suggestions by Codota
}
origin: postgresql/postgresql

public InputStream getBinaryStream(String columnName) throws SQLException
{
  return getBinaryStream(findColumn(columnName));
}
origin: postgresql/postgresql

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);
  }
}
origin: postgresql/postgresql

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);
  }
}
origin: postgresql/postgresql

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);
    }
  }
}
origin: org.ancoron.postgresql/org.postgresql.osgi

public InputStream getBinaryStream(String columnName) throws SQLException
{
  return getBinaryStream(findColumn(columnName));
}
origin: org.ancoron.postgresql/org.postgresql

public InputStream getBinaryStream(String columnName) throws SQLException
{
  return getBinaryStream(findColumn(columnName));
}
origin: org.ancoron.postgresql/org.postgresql

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);
  }
}
origin: org.ancoron.postgresql/org.postgresql

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);
  }
}
origin: org.ancoron.postgresql/org.postgresql.osgi

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);
  }
}
origin: org.ancoron.postgresql/org.postgresql.osgi

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);
  }
}
origin: org.ancoron.postgresql/org.postgresql.osgi

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);
    }
  }
}
origin: org.ancoron.postgresql/org.postgresql

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);
    }
  }
}
org.postgresql.jdbc2AbstractJdbc2ResultSetgetBinaryStream

Popular methods of AbstractJdbc2ResultSet

  • absolute
  • addWarning
  • afterLast
  • beforeFirst
  • checkClosed
  • checkColumnIndex
  • checkResultSet
    Checks that the result set is not closed, it's positioned on a valid row and that the given column n
  • checkScrollable
  • checkUpdateable
  • clearRowBuffer
  • close
  • createArray
  • close,
  • createArray,
  • findColumn,
  • findColumnIndex,
  • getArray,
  • getAsciiStream,
  • getBigDecimal,
  • getBlob,
  • getBoolean

Popular in Java

  • Making http post requests using okhttp
  • getContentResolver (Context)
  • startActivity (Activity)
  • orElseThrow (Optional)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Reference (javax.naming)
  • JFrame (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now