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

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

Best Java code snippets using org.postgresql.core.PGStream.getEncoding (Showing top 11 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: org.postgresql/postgresql

@Override
public Encoding getEncoding() {
 return pgStream.getEncoding();
}
origin: postgresql/postgresql

public Encoding getEncoding() {
  return pgStream.getEncoding();
}
origin: postgresql/postgresql

public Encoding getEncoding() {
  return pgStream.getEncoding();
}
origin: org.postgresql/postgresql

private void sendSimpleQuery(SimpleQuery query, SimpleParameterList params) throws IOException {
 String nativeSql = query.toString(params);
 LOGGER.log(Level.FINEST, " FE=> SimpleQuery(query=\"{0}\")", nativeSql);
 Encoding encoding = pgStream.getEncoding();
 byte[] encoded = encoding.encode(nativeSql);
 pgStream.sendChar('Q');
 pgStream.sendInteger4(encoded.length + 4 + 1);
 pgStream.send(encoded);
 pgStream.sendChar(0);
 pgStream.flush();
 pendingExecuteQueue.add(new ExecuteRequest(query, null, true));
 pendingDescribePortalQueue.add(query);
}
origin: postgresql/postgresql

void writeV2FastpathValue(int index, PGStream pgStream) throws IOException {
  --index;
  if (paramValues[index] instanceof StreamWrapper)
  {
    StreamWrapper wrapper = (StreamWrapper)paramValues[index];
    pgStream.SendInteger4(wrapper.getLength());
    copyStream(pgStream, wrapper);
  }
  else if (paramValues[index] instanceof byte[])
  {
    byte[] data = (byte[])paramValues[index];
    pgStream.SendInteger4(data.length);
    pgStream.Send(data);
  }
  else if (paramValues[index] instanceof String)
  {
    byte[] data = pgStream.getEncoding().encode((String)paramValues[index]);
    pgStream.SendInteger4(data.length);
    pgStream.Send(data);
  }
  else
  {
    throw new IllegalArgumentException("don't know how to stream parameter " + index);
  }
}
origin: org.ancoron.postgresql/org.postgresql

public Encoding getEncoding() {
  return pgStream.getEncoding();
}
origin: org.ancoron.postgresql/org.postgresql.osgi

public Encoding getEncoding() {
  return pgStream.getEncoding();
}
origin: org.ancoron.postgresql/org.postgresql

public Encoding getEncoding() {
  return pgStream.getEncoding();
}
origin: org.ancoron.postgresql/org.postgresql.osgi

public Encoding getEncoding() {
  return pgStream.getEncoding();
}
origin: org.ancoron.postgresql/org.postgresql.osgi

void writeV2FastpathValue(int index, PGStream pgStream) throws IOException {
  --index;
  if (paramValues[index] instanceof StreamWrapper)
  {
    StreamWrapper wrapper = (StreamWrapper)paramValues[index];
    pgStream.SendInteger4(wrapper.getLength());
    copyStream(pgStream, wrapper);
  }
  else if (paramValues[index] instanceof byte[])
  {
    byte[] data = (byte[])paramValues[index];
    pgStream.SendInteger4(data.length);
    pgStream.Send(data);
  }
  else if (paramValues[index] instanceof String)
  {
    byte[] data = pgStream.getEncoding().encode((String)paramValues[index]);
    pgStream.SendInteger4(data.length);
    pgStream.Send(data);
  }
  else
  {
    throw new IllegalArgumentException("don't know how to stream parameter " + index);
  }
}
origin: org.ancoron.postgresql/org.postgresql

void writeV2FastpathValue(int index, PGStream pgStream) throws IOException {
  --index;
  if (paramValues[index] instanceof StreamWrapper)
  {
    StreamWrapper wrapper = (StreamWrapper)paramValues[index];
    pgStream.SendInteger4(wrapper.getLength());
    copyStream(pgStream, wrapper);
  }
  else if (paramValues[index] instanceof byte[])
  {
    byte[] data = (byte[])paramValues[index];
    pgStream.SendInteger4(data.length);
    pgStream.Send(data);
  }
  else if (paramValues[index] instanceof String)
  {
    byte[] data = pgStream.getEncoding().encode((String)paramValues[index]);
    pgStream.SendInteger4(data.length);
    pgStream.Send(data);
  }
  else
  {
    throw new IllegalArgumentException("don't know how to stream parameter " + index);
  }
}
org.postgresql.corePGStreamgetEncoding

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.
  • 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
  • ReceiveInteger4
    Receives a four byte integer from the backend
  • ReceiveInteger2,
  • ReceiveInteger4,
  • ReceiveString,
  • ReceiveTupleV2,
  • ReceiveTupleV3,
  • Send,
  • SendChar,
  • SendInteger2,
  • SendInteger4

Popular in Java

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • setScale (BigDecimal)
  • onCreateOptionsMenu (Activity)
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Reference (javax.naming)
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