Tabnine Logo
CopyOperationImpl
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.postgresql/postgresql

    PSQLState.OBJECT_NOT_IN_STATE);
 op.handleCommandStatus(status);
} catch (SQLException se) {
 error = se;
   PSQLState.COMMUNICATION_ERROR);
} else {
 op.handleCopydata(buf);
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.postgresql/postgresql

/**
 * Finishes writing to copy and unlocks connection.
 *
 * @param op the copy operation presumably currently holding lock on this connection
 * @return number of rows updated for server versions 8.2 or newer
 * @throws SQLException on failure
 */
public synchronized long endCopy(CopyOperationImpl op) throws SQLException {
 if (!hasLock(op)) {
  throw new PSQLException(GT.tr("Tried to end inactive copy"), PSQLState.OBJECT_NOT_IN_STATE);
 }
 try {
  LOGGER.log(Level.FINEST, " FE=> CopyDone");
  pgStream.sendChar('c'); // CopyDone
  pgStream.sendInteger4(4);
  pgStream.flush();
  do {
   processCopyResults(op, true);
  } while (hasLock(op));
  return op.getHandledRowCount();
 } catch (IOException ioe) {
  throw new PSQLException(GT.tr("Database connection failed when ending copy"),
    PSQLState.CONNECTION_FAILURE, ioe);
 }
}
origin: postgresql/postgresql

  if(op == null)
    throw new PSQLException(GT.tr("Received CommandComplete ''{0}'' without an active copy operation", status), PSQLState.OBJECT_NOT_IN_STATE);
  op.handleCommandStatus(status);
} catch(SQLException se) {
  error = se;
origin: org.ancoron.postgresql/org.postgresql.osgi

  if(op == null)
    throw new PSQLException(GT.tr("Received CommandComplete ''{0}'' without an active copy operation", status), PSQLState.OBJECT_NOT_IN_STATE);
  op.handleCommandStatus(status);
} catch(SQLException se) {
  error = se;
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: org.ancoron.postgresql/org.postgresql

  if(op == null)
    throw new PSQLException(GT.tr("Received CommandComplete ''{0}'' without an active copy operation", status), PSQLState.OBJECT_NOT_IN_STATE);
  op.handleCommandStatus(status);
} catch(SQLException se) {
  error = se;
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);
}
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);
}
org.postgresql.core.v3CopyOperationImpl

Most used methods

  • handleCommandStatus
  • init
  • getHandledRowCount
  • handleCopydata
    Consume received copy data.

Popular in Java

  • Reading from database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • setRequestProperty (URLConnection)
  • onCreateOptionsMenu (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JOptionPane (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top 17 Free Sublime Text 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