congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
PGStream.ReceiveString
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: postgresql/postgresql

private SQLWarning receiveNotification() throws IOException {
  String warnMsg = pgStream.ReceiveString();
  // Strip out the severity field so we have consistency with
  // the V3 protocol.  SQLWarning.getMessage should return just
  // the actual message.
  //
  int severityMark = warnMsg.indexOf(":");
  warnMsg = warnMsg.substring(severityMark+1).trim();
  if (logger.logDebug())
    logger.debug(" <=BE NoticeResponse(" + warnMsg + ")");
  return new SQLWarning(warnMsg);
}
origin: postgresql/postgresql

private SQLException receiveErrorMessage() throws IOException {
  String errorMsg = pgStream.ReceiveString().trim();
  if (logger.logDebug())
    logger.debug(" <=BE ErrorResponse(" + errorMsg + ")");
  return new PSQLException(errorMsg, PSQLState.UNKNOWN_STATE);
}
origin: postgresql/postgresql

private void receiveAsyncNotify() throws IOException {
  int msglen = pgStream.ReceiveInteger4();
  int pid = pgStream.ReceiveInteger4();
  String msg = pgStream.ReceiveString();
  String param = pgStream.ReceiveString();
  protoConnection.addNotification(new org.postgresql.core.Notification(msg, pid, param));
  if (logger.logDebug())
    logger.debug(" <=BE AsyncNotify(" + pid + "," + msg + "," + param + ")");
}
origin: postgresql/postgresql

private String receiveCommandStatus() throws IOException {
  //TODO: better handle the msg len
  int l_len = pgStream.ReceiveInteger4();
  //read l_len -5 bytes (-4 for l_len and -1 for trailing \0)
  String status = pgStream.ReceiveString(l_len - 5);
  //now read and discard the trailing \0
  pgStream.Receive(1);
  if (logger.logDebug())
    logger.debug(" <=BE CommandStatus(" + status + ")");
  return status;
}
origin: postgresql/postgresql

private void receiveAsyncNotify() throws IOException {
  int pid = pgStream.ReceiveInteger4();
  String msg = pgStream.ReceiveString();
  if (logger.logDebug())
    logger.debug(" <=BE AsyncNotify(pid=" + pid + ",msg=" + msg + ")");
  protoConnection.addNotification(new org.postgresql.core.Notification(msg, pid));
}
origin: postgresql/postgresql

private SQLException receiveErrorResponse() throws IOException {
  // it's possible to get more than one error message for a query
  // see libpq comments wrt backend closing a connection
  // so, append messages to a string buffer and keep processing
  // check at the bottom to see if we need to throw an exception
  int elen = pgStream.ReceiveInteger4();
  String totalMessage = pgStream.ReceiveString(elen - 4);
  ServerErrorMessage errorMsg = new ServerErrorMessage(totalMessage, logger.getLogLevel());
  if (logger.logDebug())
    logger.debug(" <=BE ErrorMessage(" + errorMsg.toString() + ")");
  return new PSQLException(errorMsg);
}
origin: postgresql/postgresql

private SQLWarning receiveNoticeResponse() throws IOException {
  int nlen = pgStream.ReceiveInteger4();
  ServerErrorMessage warnMsg = new ServerErrorMessage(pgStream.ReceiveString(nlen - 4), logger.getLogLevel());
  if (logger.logDebug())
    logger.debug(" <=BE NoticeResponse(" + warnMsg.toString() + ")");
  return new PSQLWarning(warnMsg);
}
origin: postgresql/postgresql

private Field[] receiveFields() throws IOException
{
  int size = pgStream.ReceiveInteger2();
  Field[] fields = new Field[size];
  if (logger.logDebug())
    logger.debug(" <=BE RowDescription(" + fields.length + ")");
  for (int i = 0; i < fields.length; i++)
  {
    String columnLabel = pgStream.ReceiveString();
    int typeOid = pgStream.ReceiveInteger4();
    int typeLength = pgStream.ReceiveInteger2();
    int typeModifier = pgStream.ReceiveInteger4();
    fields[i] = new Field(columnLabel, columnLabel, typeOid, typeLength, typeModifier, 0, 0);
  }
  return fields;
}
origin: postgresql/postgresql

String status = pgStream.ReceiveString();
String portalName = pgStream.ReceiveString();
if (logger.logDebug())
  logger.debug(" <=BE PortalName(" + portalName + ")");
origin: postgresql/postgresql

ServerErrorMessage l_errorMsg = new ServerErrorMessage(pgStream.ReceiveString(l_elen - 4), logger.getLogLevel());
ServerErrorMessage l_warnMsg = new ServerErrorMessage(pgStream.ReceiveString(l_nlen - 4), logger.getLogLevel());
String name = pgStream.ReceiveString();
String value = pgStream.ReceiveString();
origin: postgresql/postgresql

String errorMsg = pgStream.ReceiveString();
if (logger.logDebug())
  logger.debug(" <=BE ErrorResponse(" + errorMsg + ")");
String warnMsg = pgStream.ReceiveString();
if (logger.logDebug())
  logger.debug(" <=BE NoticeResponse(" + warnMsg + ")");
origin: postgresql/postgresql

private Field[] receiveFields() throws IOException
{
  int l_msgSize = pgStream.ReceiveInteger4();
  int size = pgStream.ReceiveInteger2();
  Field[] fields = new Field[size];
  if (logger.logDebug())
    logger.debug(" <=BE RowDescription(" + size + ")");
  for (int i = 0; i < fields.length; i++)
  {
    String columnLabel = pgStream.ReceiveString();
    int tableOid = pgStream.ReceiveInteger4();
    short positionInTable = (short)pgStream.ReceiveInteger2();
    int typeOid = pgStream.ReceiveInteger4();
    int typeLength = pgStream.ReceiveInteger2();
    int typeModifier = pgStream.ReceiveInteger4();
    int formatType = pgStream.ReceiveInteger2();
    fields[i] = new Field(columnLabel,
               "",  /* name not yet determined */
               typeOid, typeLength, typeModifier, tableOid, positionInTable);
    fields[i].setFormat(formatType);
  }
  return fields;
}
origin: postgresql/postgresql

String name = pgStream.ReceiveString();
String value = pgStream.ReceiveString();
if (logger.logDebug())
  logger.debug(" <=BE ParameterStatus(" + name + " = " + value + ")");
origin: postgresql/postgresql

ServerErrorMessage errorMsg = new ServerErrorMessage(pgStream.ReceiveString(l_elen - 4), logger.getLogLevel());
if (logger.logDebug())
  logger.debug(" <=BE ErrorMessage(" + errorMsg + ")");
origin: postgresql/postgresql

String errorMsg = pgStream.ReceiveString();
if (logger.logDebug())
  logger.debug(" <=BE ErrorMessage(" + errorMsg + ")");
origin: postgresql/postgresql

ServerErrorMessage l_errorMsg = new ServerErrorMessage(pgStream.ReceiveString(l_elen - 4), logger.getLogLevel());
origin: org.ancoron.postgresql/org.postgresql.osgi

private SQLException receiveErrorMessage() throws IOException {
  String errorMsg = pgStream.ReceiveString().trim();
  if (logger.logDebug())
    logger.debug(" <=BE ErrorResponse(" + errorMsg + ")");
  return new PSQLException(errorMsg, PSQLState.UNKNOWN_STATE);
}
origin: org.ancoron.postgresql/org.postgresql

private void receiveAsyncNotify() throws IOException {
  int pid = pgStream.ReceiveInteger4();
  String msg = pgStream.ReceiveString();
  if (logger.logDebug())
    logger.debug(" <=BE AsyncNotify(pid=" + pid + ",msg=" + msg + ")");
  protoConnection.addNotification(new org.postgresql.core.Notification(msg, pid));
}
origin: org.ancoron.postgresql/org.postgresql.osgi

private SQLException receiveErrorResponse() throws IOException {
  // it's possible to get more than one error message for a query
  // see libpq comments wrt backend closing a connection
  // so, append messages to a string buffer and keep processing
  // check at the bottom to see if we need to throw an exception
  int elen = pgStream.ReceiveInteger4();
  String totalMessage = pgStream.ReceiveString(elen - 4);
  ServerErrorMessage errorMsg = new ServerErrorMessage(totalMessage, logger.getLogLevel());
  if (logger.logDebug())
    logger.debug(" <=BE ErrorMessage(" + errorMsg.toString() + ")");
  return new PSQLException(errorMsg);
}
origin: org.ancoron.postgresql/org.postgresql.osgi

private SQLWarning receiveNoticeResponse() throws IOException {
  int nlen = pgStream.ReceiveInteger4();
  ServerErrorMessage warnMsg = new ServerErrorMessage(pgStream.ReceiveString(nlen - 4), logger.getLogLevel());
  if (logger.logDebug())
    logger.debug(" <=BE NoticeResponse(" + warnMsg.toString() + ")");
  return new PSQLWarning(warnMsg);
}
org.postgresql.corePGStreamReceiveString

Javadoc

Receives a null-terminated string from the backend. If we don't see a null, then we assume something has gone wrong.

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,
  • ReceiveTupleV2,
  • ReceiveTupleV3,
  • Send,
  • SendChar,
  • SendInteger2,
  • SendInteger4

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • onRequestPermissionsResult (Fragment)
  • runOnUiThread (Activity)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Permission (java.security)
    Legacy security code; do not use.
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now