Codota Logo
PGStream.getEncodingWriter
Code IndexAdd Codota to your IDE (free)

How to use
getEncodingWriter
method
in
org.postgresql.core.PGStream

Best Java code snippets using org.postgresql.core.PGStream.getEncodingWriter (Showing top 3 results out of 315)

  • Common ways to obtain PGStream
private void myMethod () {
PGStream p =
  • Codota IconString host;new PGStream(host, port)
  • Smart code suggestions by Codota
}
origin: postgresql/postgresql

protected void sendQuery(V2Query query, SimpleParameterList params, String queryPrefix) throws IOException {
  if (logger.logDebug())
    logger.debug(" FE=> Query(\"" + (queryPrefix == null ? "" : queryPrefix) + query.toString(params) + "\")");
  pgStream.SendChar('Q');
  Writer encodingWriter = pgStream.getEncodingWriter();
  if (queryPrefix != null)
    encodingWriter.write(queryPrefix);
  String[] fragments = query.getFragments();
  for (int i = 0 ; i < fragments.length; ++i)
  {
    encodingWriter.write(fragments[i]);
    if (i < params.getParameterCount())
      params.writeV2Value(i + 1, encodingWriter);
  }
  encodingWriter.write(0);
  pgStream.flush();
}
origin: org.ancoron.postgresql/org.postgresql

protected void sendQuery(V2Query query, SimpleParameterList params, String queryPrefix) throws IOException {
  if (logger.logDebug())
    logger.debug(" FE=> Query(\"" + (queryPrefix == null ? "" : queryPrefix) + query.toString(params) + "\")");
  pgStream.SendChar('Q');
  Writer encodingWriter = pgStream.getEncodingWriter();
  if (queryPrefix != null)
    encodingWriter.write(queryPrefix);
  String[] fragments = query.getFragments();
  for (int i = 0 ; i < fragments.length; ++i)
  {
    encodingWriter.write(fragments[i]);
    if (i < params.getParameterCount())
      params.writeV2Value(i + 1, encodingWriter);
  }
  encodingWriter.write(0);
  pgStream.flush();
}
origin: org.ancoron.postgresql/org.postgresql.osgi

protected void sendQuery(V2Query query, SimpleParameterList params, String queryPrefix) throws IOException {
  if (logger.logDebug())
    logger.debug(" FE=> Query(\"" + (queryPrefix == null ? "" : queryPrefix) + query.toString(params) + "\")");
  pgStream.SendChar('Q');
  Writer encodingWriter = pgStream.getEncodingWriter();
  if (queryPrefix != null)
    encodingWriter.write(queryPrefix);
  String[] fragments = query.getFragments();
  for (int i = 0 ; i < fragments.length; ++i)
  {
    encodingWriter.write(fragments[i]);
    if (i < params.getParameterCount())
      params.writeV2Value(i + 1, encodingWriter);
  }
  encodingWriter.write(0);
  pgStream.flush();
}
org.postgresql.corePGStreamgetEncodingWriter

Javadoc

Get a Writer instance that encodes directly onto the underlying stream.

The returned Writer should not be closed, as it's a shared object. Writer.flush needs to be called when switching between use of the Writer and use of the PGStream write methods, but it won't actually flush output all the way out -- call #flush to actually ensure all output has been pushed to the server.

Popular methods of PGStream

  • <init>
    Constructor: Connect to the PostgreSQL back end and return a stream connection.
  • changeSocket
    Switch this stream to using a new socket. Any existing socket is not closed; it's assumed that we ar
  • close
    Closes the connection.
  • flush
    Flush any pending output to the backend.
  • getEncoding
  • getSocket
  • hasMessagePending
    Check for pending backend messages without blocking. Might return false when there actually are mess
  • setEncoding
    Change the encoding used by this connection.
  • Receive
    Reads in a given number of bytes from the backend
  • ReceiveChar
    Receives a single character from the backend
  • ReceiveEOF
    Consume an expected EOF from the backend
  • ReceiveInteger2
    Receives a two byte integer from the backend
  • ReceiveEOF,
  • ReceiveInteger2,
  • ReceiveInteger4,
  • ReceiveString,
  • ReceiveTupleV2,
  • ReceiveTupleV3,
  • Send,
  • SendChar,
  • SendInteger2,
  • SendInteger4

Popular in Java

  • Reading from database using SQL prepared statement
  • getSystemService (Context)
  • runOnUiThread (Activity)
  • setContentView (Activity)
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Runner (org.openjdk.jmh.runner)
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