Codota Logo
ProtocolConnectionImpl
Code IndexAdd Codota to your IDE (free)

How to use
ProtocolConnectionImpl
in
org.postgresql.core.v3

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

  • Common ways to obtain ProtocolConnectionImpl
private void myMethod () {
ProtocolConnectionImpl p =
  • Codota IconPGStream pgStream;String user;String database;Properties info;Logger logger;new ProtocolConnectionImpl(pgStream, user, database, info, logger)
  • Smart code suggestions by Codota
}
origin: postgresql/postgresql

ProtocolConnectionImpl protoConnection = new ProtocolConnectionImpl(newStream, user, database, info, logger);
readStartupMessages(newStream, protoConnection, logger);
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

  protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_IDLE);
  break;
case 'T':
  protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_OPEN);
  break;
case 'E':
  protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_FAILED);
  break;
default:
  logger.debug(" <=BE BackendKeyData(pid=" + pid + ",ckey=" + ckey + ")");
protoConnection.setBackendKeyData(pid, ckey);
break;
  logger.debug(" <=BE NoticeResponse(" + l_warnMsg + ")");
protoConnection.addWarning(new PSQLWarning(l_warnMsg));
break;
  protoConnection.setServerVersion(value);
else if (name.equals("client_encoding"))
    protoConnection.setStandardConformingStrings(true);
  else if (value.equals("off"))
    protoConnection.setStandardConformingStrings(false);
  else
    throw new PSQLException(GT.tr("Protocol error.  Session setup failed."), PSQLState.PROTOCOL_VIOLATION);
origin: postgresql/postgresql

boolean supportsEStringSyntax = false;
if (protoConnection != null) {
  standardConformingStrings = protoConnection.getStandardConformingStrings();
  supportsEStringSyntax = protoConnection.getServerVersion().compareTo("8.1") >= 0;
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

public synchronized byte[]
fastpathCall(int fnid, ParameterList parameters, boolean suppressBegin) throws SQLException {
  waitOnLock();
  if (!suppressBegin)
  {
    doSubprotocolBegin();
  }
  try
  {
    sendFastpathCall(fnid, (SimpleParameterList)parameters);
    return receiveFastpathResult();
  }
  catch (IOException ioe)
  {
    protoConnection.close();
    throw new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, ioe);
  }
}
origin: postgresql/postgresql

protoConnection.close(); // we're screwed now; we can't trust any subsequent string.
handler.handleError(new PSQLException(GT.tr("The server''s client_encoding parameter was changed to {0}. The JDBC driver requires client_encoding to be UTF8 for correct operation.", value), PSQLState.CONNECTION_FAILURE));
endQuery = true;
protoConnection.close(); // we're screwed now; we can't trust any subsequent date.
handler.handleError(new PSQLException(GT.tr("The server''s DateStyle parameter was changed to {0}. The JDBC driver requires DateStyle to begin with ISO for correct operation.", value), PSQLState.CONNECTION_FAILURE));
endQuery = true;
  protoConnection.setStandardConformingStrings(true);
else if (value.equals("off"))
  protoConnection.setStandardConformingStrings(false);
else
  protoConnection.close(); // we're screwed now; we don't know how to escape string literals
  handler.handleError(new PSQLException(GT.tr("The server''s standard_conforming_strings parameter was reported as {0}. The JDBC driver expected on or off.", value), PSQLState.CONNECTION_FAILURE));
  endQuery = true;
origin: postgresql/postgresql

  protoConnection.getTransactionState() != ProtocolConnection.TRANSACTION_IDLE)
return delegateHandler;
origin: postgresql/postgresql

protoConnection.addWarning(warning);
break;
origin: postgresql/postgresql

protoConnection.sendQueryCancel();
origin: postgresql/postgresql

int inParen = 0;
boolean standardConformingStrings = protoConnection.getStandardConformingStrings();
origin: postgresql/postgresql

protoConnection.close();
handler.handleError(new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, e));
origin: org.ancoron.postgresql/org.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: org.ancoron.postgresql/org.postgresql

boolean supportsEStringSyntax = false;
if (protoConnection != null) {
  standardConformingStrings = protoConnection.getStandardConformingStrings();
  supportsEStringSyntax = protoConnection.getServerVersion().compareTo("8.1") >= 0;
origin: org.ancoron.postgresql/org.postgresql.osgi

protoConnection.close(); // we're screwed now; we can't trust any subsequent string.
handler.handleError(new PSQLException(GT.tr("The server''s client_encoding parameter was changed to {0}. The JDBC driver requires client_encoding to be UNICODE for correct operation.", value), PSQLState.CONNECTION_FAILURE));
endQuery = true;
protoConnection.close(); // we're screwed now; we can't trust any subsequent date.
handler.handleError(new PSQLException(GT.tr("The server''s DateStyle parameter was changed to {0}. The JDBC driver requires DateStyle to begin with ISO for correct operation.", value), PSQLState.CONNECTION_FAILURE));
endQuery = true;
  protoConnection.setStandardConformingStrings(true);
else if (value.equals("off"))
  protoConnection.setStandardConformingStrings(false);
else
  protoConnection.close(); // we're screwed now; we don't know how to escape string literals
  handler.handleError(new PSQLException(GT.tr("The server''s standard_conforming_strings parameter was reported as {0}. The JDBC driver expected on or off.", value), PSQLState.CONNECTION_FAILURE));
  endQuery = true;
origin: postgresql/postgresql

public void doSubprotocolBegin() throws SQLException {
  if (protoConnection.getTransactionState() == ProtocolConnection.TRANSACTION_IDLE)
origin: postgresql/postgresql

  logger.debug(" <=BE Notification while copying");
protoConnection.addWarning(receiveNoticeResponse());
break;
origin: org.ancoron.postgresql/org.postgresql.osgi

protoConnection.sendQueryCancel();
origin: org.ancoron.postgresql/org.postgresql

int inParen = 0;
boolean standardConformingStrings = protoConnection.getStandardConformingStrings();
origin: org.ancoron.postgresql/org.postgresql

  protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_IDLE);
  break;
case 'T':
  protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_OPEN);
  break;
case 'E':
  protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_FAILED);
  break;
default:
  logger.debug(" <=BE BackendKeyData(pid=" + pid + ",ckey=" + ckey + ")");
protoConnection.setBackendKeyData(pid, ckey);
break;
  logger.debug(" <=BE NoticeResponse(" + l_warnMsg + ")");
protoConnection.addWarning(new PSQLWarning(l_warnMsg));
break;
  protoConnection.setServerVersion(value);
else if (name.equals("client_encoding"))
    protoConnection.setStandardConformingStrings(true);
  else if (value.equals("off"))
    protoConnection.setStandardConformingStrings(false);
  else
    throw new PSQLException(GT.tr("Protocol error.  Session setup failed."), PSQLState.PROTOCOL_VIOLATION);
org.postgresql.core.v3ProtocolConnectionImpl

Javadoc

ProtocolConnection implementation for the V3 protocol.

Most used methods

  • <init>
  • addNotification
  • addWarning
  • close
  • getServerVersion
  • getStandardConformingStrings
  • getTransactionState
  • sendQueryCancel
  • setBackendKeyData
  • setServerVersion
  • setStandardConformingStrings
  • setTransactionState
  • setStandardConformingStrings,
  • setTransactionState

Popular in Java

  • Making http requests using okhttp
  • putExtra (Intent)
  • getSharedPreferences (Context)
  • getContentResolver (Context)
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • 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