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

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

Best Java code snippets using org.postgresql.core.PGStream.ReceiveChar (Showing top 20 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

private void receiveRFQ() throws IOException {
  if (pgStream.ReceiveInteger4() != 5)
    throw new IOException("unexpected length of ReadyForQuery message");
  char tStatus = (char)pgStream.ReceiveChar();
  if (logger.logDebug())
    logger.debug(" <=BE ReadyForQuery(" + tStatus + ")");
  // Update connection state.
  switch (tStatus)
  {
  case 'I':
    protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_IDLE);
    break;
  case 'T':
    protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_OPEN);
    break;
  case 'E':
    protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_FAILED);
    break;
  default:
    throw new IOException("unexpected transaction state in ReadyForQuery message: " + (int)tStatus);
  }
}
origin: postgresql/postgresql

/**
 * Locks connection and calls initializer for a new CopyOperation
 * Called via startCopy -> processCopyResults
 * @param op an unitialized CopyOperation
 * @throws SQLException on locking failure
 * @throws IOException on database connection failure
 */
private synchronized void initCopy(CopyOperationImpl op) throws SQLException, IOException {
  pgStream.ReceiveInteger4(); // length not used
  int rowFormat = pgStream.ReceiveChar();
  int numFields = pgStream.ReceiveInteger2();
  int[] fieldFormats = new int[numFields];
  for(int i=0; i<numFields; i++)
    fieldFormats[i] = pgStream.ReceiveInteger2();
  lock(op);
  op.init(this, rowFormat, fieldFormats);
}
origin: postgresql/postgresql

int c = pgStream.ReceiveChar();
  c = pgStream.ReceiveChar();
  if (c == 'G')
    c = pgStream.ReceiveChar();
origin: postgresql/postgresql

public synchronized void processNotifies() throws SQLException {
  // Asynchronous notifies only arrive when we are not in a transaction
  if (protoConnection.getTransactionState() != ProtocolConnection.TRANSACTION_IDLE)
    return;
    
  try {
    while (pgStream.hasMessagePending()) {
      int c = pgStream.ReceiveChar();
      switch (c) {
      case 'A':  // Asynchronous Notify
        receiveAsyncNotify();
        break;
      case 'E':  // Error Message
        throw receiveErrorMessage();
        // break;
      case 'N':  // Error Notification
        protoConnection.addWarning(receiveNotification());
        break;
      default:
        throw new PSQLException(GT.tr("Unknown Response Type {0}.", new Character((char) c)), PSQLState.CONNECTION_FAILURE);
      }
    }
  } catch (IOException ioe) {
    throw new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, ioe);
  }
}
origin: postgresql/postgresql

public synchronized void processNotifies() throws SQLException {
  waitOnLock();
  // Asynchronous notifies only arrive when we are not in a transaction
  if (protoConnection.getTransactionState() != ProtocolConnection.TRANSACTION_IDLE)
    return;
  try {
    while (pgStream.hasMessagePending()) {
      int c = pgStream.ReceiveChar();
      switch (c) {
      case 'A':  // Asynchronous Notify
        receiveAsyncNotify();
        break;
      case 'E':  // Error Response (response to pretty much everything; backend then skips until Sync)
        throw receiveErrorResponse();
        // break;
      case 'N':  // Notice Response (warnings / info)
        SQLWarning warning = receiveNoticeResponse();
        protoConnection.addWarning(warning);
        break;
      default:
        throw new PSQLException(GT.tr("Unknown Response Type {0}.", new Character((char) c)), PSQLState.CONNECTION_FAILURE);
      }
    }
  } catch (IOException ioe) {
    throw new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, ioe);
  }
}

origin: postgresql/postgresql

while (!endQuery)
  int c = pgStream.ReceiveChar();
    if (logger.logDebug())
      logger.debug(" <=BE EmptyQuery");
    c = pgStream.ReceiveChar();
    if (c != 0)
      throw new IOException("Expected \\0 after EmptyQuery, got: " + c);
origin: postgresql/postgresql

int c = pgStream.ReceiveChar();
switch (c)
origin: postgresql/postgresql

c = pgStream.ReceiveChar();
switch (c)
origin: postgresql/postgresql

private void readStartupMessages(PGStream pgStream, ProtocolConnectionImpl protoConnection, Logger logger) throws IOException, SQLException {
  while (true)
    int beresp = pgStream.ReceiveChar();
    switch (beresp)
        throw new IOException("unexpected length of ReadyForQuery packet");
      char tStatus = (char)pgStream.ReceiveChar();
      if (logger.logDebug())
        logger.debug(" <=BE ReadyForQuery(" + tStatus + ")");
origin: postgresql/postgresql

int beresp = pgStream.ReceiveChar();
origin: postgresql/postgresql

int beresp = pgStream.ReceiveChar();
origin: postgresql/postgresql

int c = pgStream.ReceiveChar();
switch(c) {
origin: postgresql/postgresql

private void readStartupMessages(PGStream pgStream, ProtocolConnectionImpl protoConnection, Logger logger) throws IOException, SQLException {
  while (true)
    int beresp = pgStream.ReceiveChar();
    switch (beresp)
origin: postgresql/postgresql

int response = pgStream.ReceiveChar();
origin: postgresql/postgresql

int beresp = pgStream.ReceiveChar();
switch (beresp)
origin: postgresql/postgresql

int beresp = pgStream.ReceiveChar();
switch (beresp)
origin: org.ancoron.postgresql/org.postgresql

private void receiveRFQ() throws IOException {
  if (pgStream.ReceiveInteger4() != 5)
    throw new IOException("unexpected length of ReadyForQuery message");
  char tStatus = (char)pgStream.ReceiveChar();
  if (logger.logDebug())
    logger.debug(" <=BE ReadyForQuery(" + tStatus + ")");
  // Update connection state.
  switch (tStatus)
  {
  case 'I':
    protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_IDLE);
    break;
  case 'T':
    protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_OPEN);
    break;
  case 'E':
    protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_FAILED);
    break;
  default:
    throw new IOException("unexpected transaction state in ReadyForQuery message: " + (int)tStatus);
  }
}
origin: org.ancoron.postgresql/org.postgresql.osgi

private void receiveRFQ() throws IOException {
  if (pgStream.ReceiveInteger4() != 5)
    throw new IOException("unexpected length of ReadyForQuery message");
  char tStatus = (char)pgStream.ReceiveChar();
  if (logger.logDebug())
    logger.debug(" <=BE ReadyForQuery(" + tStatus + ")");
  // Update connection state.
  switch (tStatus)
  {
  case 'I':
    protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_IDLE);
    break;
  case 'T':
    protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_OPEN);
    break;
  case 'E':
    protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_FAILED);
    break;
  default:
    throw new IOException("unexpected transaction state in ReadyForQuery message: " + (int)tStatus);
  }
}
origin: org.ancoron.postgresql/org.postgresql.osgi

/**
 * Locks connection and calls initializer for a new CopyOperation
 * Called via startCopy -> processCopyResults
 * @param op an unitialized CopyOperation
 * @throws SQLException on locking failure
 * @throws IOException on database connection failure
 */
private synchronized void initCopy(CopyOperationImpl op) throws SQLException, IOException {
  pgStream.ReceiveInteger4(); // length not used
  int rowFormat = pgStream.ReceiveChar();
  int numFields = pgStream.ReceiveInteger2();
  int[] fieldFormats = new int[numFields];
  for(int i=0; i<numFields; i++)
    fieldFormats[i] = pgStream.ReceiveInteger2();
  lock(op);
  op.init(this, rowFormat, fieldFormats);
}
origin: org.ancoron.postgresql/org.postgresql

/**
 * Locks connection and calls initializer for a new CopyOperation
 * Called via startCopy -> processCopyResults
 * @param op an unitialized CopyOperation
 * @throws SQLException on locking failure
 * @throws IOException on database connection failure
 */
private synchronized void initCopy(CopyOperationImpl op) throws SQLException, IOException {
  pgStream.ReceiveInteger4(); // length not used
  int rowFormat = pgStream.ReceiveChar();
  int numFields = pgStream.ReceiveInteger2();
  int[] fieldFormats = new int[numFields];
  for(int i=0; i<numFields; i++)
    fieldFormats[i] = pgStream.ReceiveInteger2();
  lock(op);
  op.init(this, rowFormat, fieldFormats);
}
org.postgresql.corePGStreamReceiveChar

Javadoc

Receives a single character from the backend

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
  • 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

  • Start an intent from android
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • BoxLayout (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