congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
QueryExecutorImpl
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: postgresql/postgresql

ProtocolConnectionImpl(PGStream pgStream, String user, String database, Properties info, Logger logger) {
  this.pgStream = pgStream;
  this.user = user;
  this.database = database;
  this.logger = logger;
  this.executor = new QueryExecutorImpl(this, pgStream, info, logger);
  // default value for server versions that don't report standard_conforming_strings
  this.standardConformingStrings = false;
}
origin: org.postgresql/postgresql

public void cancelCopy() throws SQLException {
 queryExecutor.cancelCopy(this);
}
origin: org.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) {
  abort();
  throw new PSQLException(GT.tr("An I/O error occurred while sending to the backend."),
    PSQLState.CONNECTION_FAILURE, ioe);
 }
}
origin: postgresql/postgresql

/**
 * Blocks to wait for a row of data to be received from server on an active copy operation
 * Connection gets unlocked by processCopyResults() at end of operation
 * @param op the copy operation presumably currently holding lock on this connection
 * @throws SQLException on any failure
 */
synchronized void readFromCopy(CopyOutImpl op) throws SQLException {
  if(!hasLock(op))
    throw new PSQLException(GT.tr("Tried to read from inactive copy"), PSQLState.OBJECT_NOT_IN_STATE);
  try {
    processCopyResults(op, true); // expect a call to handleCopydata() to store the data
  } catch(IOException ioe) {
    throw new PSQLException(GT.tr("Database connection failed when reading from copy"), PSQLState.CONNECTION_FAILURE, ioe);
  }
}
origin: postgresql/postgresql

receiveAsyncNotify();
break;
registerParsedQuery(parsedQuery, parsedStatementName);
break;
registerOpenPortal(boundPortal);
break;
String status = receiveCommandStatus();
      interpretCommandStatus(status, handler);
    interpretCommandStatus(status, handler);
SQLException error = receiveErrorResponse();
handler.handleError(error);
SQLWarning warning = receiveNoticeResponse();
handler.handleWarning(warning);
break;
Field[] fields = receiveFields();
tuples = new Vector();
receiveRFQ();
endQuery = true;
pgStream.SendChar(0);
origin: org.postgresql/postgresql

 receiveAsyncNotify();
 break;
 addWarning(receiveNoticeResponse());
 break;
 String status = receiveCommandStatus();
 error = receiveErrorResponse();
 initCopy(op);
 endReceiving = true;
 break;
 initCopy(op);
 endReceiving = true;
 break;
 initCopy(op);
 endReceiving = true;
 break;
case 'S': // Parameter Status
 try {
  receiveParameterStatus();
 } catch (SQLException e) {
  error = e;
 receiveRFQ();
origin: org.postgresql/postgresql

switch (c) {
 case 'A': // Asynchronous Notify
  receiveAsyncNotify();
  break;
  registerOpenPortal(boundPortal);
  break;
  String status = receiveCommandStatus();
  if (isFlushCacheOnDeallocate()
    && (status.startsWith("DEALLOCATE ALL") || status.startsWith("DISCARD ALL"))) {
   deallocateEpoch++;
    interpretCommandStatus(status, handler);
   interpretCommandStatus(status, handler);
  SQLException error = receiveErrorResponse();
  handler.handleError(error);
  if (willHealViaReparse(error)) {
  SQLWarning warning = receiveNoticeResponse();
  handler.handleWarning(warning);
  break;
   receiveParameterStatus();
  } catch (SQLException e) {
   handler.handleError(e);
origin: org.postgresql/postgresql

/**
 * Sends given query to BE to start, initialize and lock connection for a CopyOperation.
 *
 * @param sql COPY FROM STDIN / COPY TO STDOUT statement
 * @return CopyIn or CopyOut operation object
 * @throws SQLException on failure
 */
public synchronized CopyOperation startCopy(String sql, boolean suppressBegin)
  throws SQLException {
 waitOnLock();
 if (!suppressBegin) {
  doSubprotocolBegin();
 }
 byte[] buf = Utils.encodeUTF8(sql);
 try {
  LOGGER.log(Level.FINEST, " FE=> Query(CopyStart)");
  pgStream.sendChar('Q');
  pgStream.sendInteger4(buf.length + 4 + 1);
  pgStream.send(buf);
  pgStream.sendChar(0);
  pgStream.flush();
  return processCopyResults(null, true);
  // expect a CopyInResponse or CopyOutResponse to our query above
 } catch (IOException ioe) {
  throw new PSQLException(GT.tr("Database connection failed when starting copy"),
    PSQLState.CONNECTION_FAILURE, ioe);
 }
}
origin: org.postgresql/postgresql

if (!hasLock(op)) {
 throw new PSQLException(GT.tr("Tried to cancel an inactive copy operation"),
   PSQLState.OBJECT_NOT_IN_STATE);
   do {
    try {
     processCopyResults(op, true); // discard rest of input
    } catch (SQLException se) { // expected error response to failing copy
     errors++;
   } while (hasLock(op));
  sendQueryCancel();
  if (hasLock(op)) {
   unlock(op);
origin: org.postgresql/postgresql

public long endCopy() throws SQLException {
 return queryExecutor.endCopy(this);
}
origin: org.postgresql/postgresql

public void flushCopy() throws SQLException {
 queryExecutor.flushCopy(this);
}
origin: org.postgresql/postgresql

public boolean isActive() {
 synchronized (queryExecutor) {
  return queryExecutor.hasLock(this);
 }
}
origin: org.postgresql/postgresql

/**
 * Locks connection and calls initializer for a new CopyOperation Called via startCopy ->
 * processCopyResults.
 *
 * @param op an uninitialized 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.osgi

receiveAsyncNotify();
break;
registerParsedQuery(parsedQuery, parsedStatementName);
break;
registerOpenPortal(boundPortal);
break;
String status = receiveCommandStatus();
      interpretCommandStatus(status, handler);
    interpretCommandStatus(status, handler);
SQLException error = receiveErrorResponse();
handler.handleError(error);
SQLWarning warning = receiveNoticeResponse();
handler.handleWarning(warning);
break;
Field[] fields = receiveFields();
tuples = new Vector();
receiveRFQ();
endQuery = true;
pgStream.SendChar(0);
origin: postgresql/postgresql

receiveAsyncNotify();
break;
protoConnection.addWarning(receiveNoticeResponse());
break;
String status = receiveCommandStatus();
error = receiveErrorResponse();
initCopy(op);
endReceiving = true;
break;
initCopy(op);
endReceiving = true;
break;
receiveRFQ();
if(hasLock(op))
  unlock(op);
op = null;
endReceiving = true;
skipMessage();
break;
skipMessage();
break;
origin: postgresql/postgresql

public synchronized void flushCopy(CopyInImpl op) throws SQLException {
  if(!hasLock(op))
    throw new PSQLException(GT.tr("Tried to write to an inactive copy operation"), PSQLState.OBJECT_NOT_IN_STATE);
  try {
    pgStream.flush();
    processCopyResults(op, false); // collect any pending notifications without blocking
  } catch(IOException ioe) {
    throw new PSQLException(GT.tr("Database connection failed when writing to copy"), PSQLState.CONNECTION_FAILURE, ioe);
  }
}
origin: postgresql/postgresql

/**
 * Sends given query to BE to start, initialize and lock connection for a CopyOperation.
 * @param sql COPY FROM STDIN / COPY TO STDOUT statement
 * @return CopyIn or CopyOut operation object
 * @throws SQLException on failure
 */
public synchronized CopyOperation startCopy(String sql, boolean suppressBegin) throws SQLException {
  waitOnLock();
  if (!suppressBegin) {
    doSubprotocolBegin();
  }
  byte buf[] = Utils.encodeUTF8(sql);
  try {
    if (logger.logDebug())
      logger.debug(" FE=> Query(CopyStart)");
    pgStream.SendChar('Q');
    pgStream.SendInteger4(buf.length + 4 + 1);
    pgStream.Send(buf);
    pgStream.SendChar(0);
    pgStream.flush();
    return processCopyResults(null, true); // expect a CopyInResponse or CopyOutResponse to our query above
  } catch(IOException ioe) {
    throw new PSQLException(GT.tr("Database connection failed when starting copy"), PSQLState.CONNECTION_FAILURE, ioe);
  }
}
origin: org.postgresql/postgresql

public long endCopy() throws SQLException {
 return queryExecutor.endCopy(this);
}
origin: org.postgresql/postgresql

public void flushCopy() throws SQLException {
 queryExecutor.flushCopy(this);
}
origin: postgresql/postgresql

public boolean isActive() {
  synchronized(queryExecutor) {
    return queryExecutor.hasLock(this);
  }
}

org.postgresql.core.v3QueryExecutorImpl

Javadoc

QueryExecutor implementation for the V3 protocol.

Most used methods

  • <init>
  • cancelCopy
    Finishes a copy operation and unlocks connection discarding any exchanged data.
  • doSubprotocolBegin
  • endCopy
    Finishes writing to copy and unlocks connection.
  • flushCopy
  • hasLock
  • initCopy
    Locks connection and calls initializer for a new CopyOperation Called via startCopy -> processCopyRe
  • interpretCommandStatus
  • lock
    Obtain lock over this connection for given object, blocking to wait if necessary.
  • processCopyResults
    Handles copy sub protocol responses from server. Unlocks at end of sub protocol, so operations on pg
  • processDeadParsedQueries
  • processDeadPortals
  • processDeadParsedQueries,
  • processDeadPortals,
  • processResults,
  • readFromCopy,
  • receiveAsyncNotify,
  • receiveCommandStatus,
  • receiveErrorResponse,
  • receiveFastpathResult,
  • receiveFields,
  • receiveNoticeResponse

Popular in Java

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • startActivity (Activity)
  • requestLocationUpdates (LocationManager)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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