congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
org.postgresql.copy
Code IndexAdd Tabnine to your IDE (free)

How to use org.postgresql.copy

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

origin: org.postgresql/postgresql

public long endCopy() throws SQLException {
 if (at > 0) {
  op.writeToCopy(copyBuffer, 0, at);
 }
 op.endCopy();
 return getHandledRowCount();
}
origin: org.postgresql/postgresql

public int read(byte[] buf, int off, int siz) throws IOException {
 checkClosed();
 int got = 0;
 boolean didReadSomething = false;
 while (got < siz && (didReadSomething = gotBuf())) {
  buf[off + got++] = this.buf[at++];
 }
 return got == 0 && !didReadSomething ? -1 : got;
}
origin: org.postgresql/postgresql

/**
 * Use COPY FROM STDIN for very fast copying from an InputStream into a database table.
 *
 * @param sql COPY FROM STDIN statement
 * @param from a CSV file or such
 * @return number of rows updated for server 8.2 or newer; -1 for older
 * @throws SQLException on database usage issues
 * @throws IOException upon input stream or database connection failure
 */
public long copyIn(final String sql, InputStream from) throws SQLException, IOException {
 return copyIn(sql, from, DEFAULT_BUFFER_SIZE);
}
origin: org.postgresql/postgresql

public void cancelCopy() throws SQLException {
 op.cancelCopy();
}
origin: org.postgresql/postgresql

 public long getHandledRowCount() {
  return op.getHandledRowCount();
 }
}
origin: org.postgresql/postgresql

public int available() throws IOException {
 checkClosed();
 return (buf != null ? len - at : 0);
}
origin: org.postgresql/postgresql

public int read(byte[] buf) throws IOException {
 return read(buf, 0, buf.length);
}
origin: org.postgresql/postgresql

public int getFieldCount() {
 return op.getFieldCount();
}
origin: org.postgresql/postgresql

public int getFieldFormat(int field) {
 return op.getFieldFormat(field);
}
origin: org.postgresql/postgresql

public int getFieldFormat(int field) {
 return op.getFieldFormat(field);
}
origin: org.postgresql/postgresql

public int getFormat() {
 return op.getFormat();
}
origin: org.postgresql/postgresql

@Override
public boolean isClosed() {
 return closeFlag || !copyDual.isActive();
}
origin: org.postgresql/postgresql

@Override
public byte[] readFromCopy(boolean block) throws SQLException {
 return readFromCopy();
}
origin: org.postgresql/postgresql

/**
 * Use COPY FROM STDIN for very fast copying from a Reader into a database table.
 *
 * @param sql COPY FROM STDIN statement
 * @param from a CSV file or such
 * @return number of rows updated for server 8.2 or newer; -1 for older
 * @throws SQLException on database usage issues
 * @throws IOException upon reader or database connection failure
 */
public long copyIn(final String sql, Reader from) throws SQLException, IOException {
 return copyIn(sql, from, DEFAULT_BUFFER_SIZE);
}
origin: postgresql/postgresql

public long endCopy() throws SQLException {
  if(at > 0) {
    op.writeToCopy(copyBuffer, 0, at);
  }
  op.endCopy();
  return getHandledRowCount();
}
origin: org.postgresql/postgresql

public int read() throws IOException {
 checkClosed();
 return gotBuf() ? buf[at++] : -1;
}
origin: postgresql/postgresql

public int available() throws IOException {
  checkClosed();
  return ( buf != null ? len - at : 0 );
}

origin: postgresql/postgresql

/**
 * Use COPY FROM STDIN for very fast copying from an InputStream into a database table.
 * @param sql COPY FROM STDIN statement
 * @param from a CSV file or such
 * @return number of rows updated for server 8.2 or newer; -1 for older
 * @throws SQLException on database usage issues
 * @throws IOException upon input stream or database connection failure
 */
public long copyIn(final String sql, InputStream from) throws SQLException, IOException {
  return copyIn(sql, from, DEFAULT_BUFFER_SIZE);
}
origin: postgresql/postgresql

public int read(byte[] buf, int off, int siz) throws IOException {
  checkClosed();
  int got = 0;
  while( got < siz && gotBuf() ) {
    buf[off+got++] = this.buf[at++];
  }
  return got;
}
origin: postgresql/postgresql

/**
 * Use COPY FROM STDIN for very fast copying from a Reader into a database table.
 * @param sql COPY FROM STDIN statement
 * @param from a CSV file or such
 * @return number of rows updated for server 8.2 or newer; -1 for older
 * @throws SQLException on database usage issues
 * @throws IOException upon reader or database connection failure
 */
public long copyIn(final String sql, Reader from) throws SQLException, IOException {
  return copyIn(sql, from, DEFAULT_BUFFER_SIZE);
}
org.postgresql.copy

Most used classes

  • CopyManager
    API for PostgreSQL COPY bulk data transfer.
  • CopyIn
    Copy bulk data from client into a PostgreSQL table very fast.
  • PGCopyOutputStream
    OutputStream for buffered input into a PostgreSQL COPY FROM STDIN operation.
  • CopyOut
  • CopyOperation
    Exchange bulk data between client and PostgreSQL database tables. See CopyIn and CopyOut for full in
  • CopyDual
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