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

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

Best Java code snippets using org.postgresql.core.PGStream.setEncoding (Showing top 16 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: org.postgresql/postgresql

public void setEncoding(Encoding encoding) throws IOException {
 pgStream.setEncoding(encoding);
}
origin: postgresql/postgresql

void setEncoding(Encoding encoding) throws IOException {
  pgStream.setEncoding(encoding);
}
origin: postgresql/postgresql

/**
 * Switch this stream to using a new socket. Any existing socket
 * is <em>not</em> closed; it's assumed that we are changing to
 * a new socket that delegates to the original socket (e.g. SSL).
 *
 * @param socket the new socket to change to
 * @throws IOException if something goes wrong
 */
public void changeSocket(Socket socket) throws IOException {
  this.connection = socket;
  // Submitted by Jason Venner <jason@idiom.com>. Disable Nagle
  // as we are selective about flushing output only when we
  // really need to.
  connection.setTcpNoDelay(true);
  // Buffer sizes submitted by Sverre H Huseby <sverrehu@online.no>
  pg_input = new VisibleBufferedInputStream(connection.getInputStream(), 8192);
  pg_output = new BufferedOutputStream(connection.getOutputStream(), 8192);
  if (encoding != null)
    setEncoding(encoding);
}
origin: org.postgresql/postgresql

/**
 * Switch this stream to using a new socket. Any existing socket is <em>not</em> closed; it's
 * assumed that we are changing to a new socket that delegates to the original socket (e.g. SSL).
 *
 * @param socket the new socket to change to
 * @throws IOException if something goes wrong
 */
public void changeSocket(Socket socket) throws IOException {
 this.connection = socket;
 // Submitted by Jason Venner <jason@idiom.com>. Disable Nagle
 // as we are selective about flushing output only when we
 // really need to.
 connection.setTcpNoDelay(true);
 // Buffer sizes submitted by Sverre H Huseby <sverrehu@online.no>
 pg_input = new VisibleBufferedInputStream(connection.getInputStream(), 8192);
 pg_output = new BufferedOutputStream(connection.getOutputStream(), 8192);
 if (encoding != null) {
  setEncoding(encoding);
 }
}
origin: postgresql/postgresql

/**
 * Constructor:  Connect to the PostgreSQL back end and return
 * a stream connection.
 *
 * @param host the hostname to connect to
 * @param port the port number that the postmaster is sitting on
 * @exception IOException if an IOException occurs below it.
 */
public PGStream(String host, int port) throws IOException
{
  this.host = host;
  this.port = port;
  changeSocket(new Socket(host, port));
  setEncoding(Encoding.getJVMEncoding("US-ASCII"));
  _int2buf = new byte[2];
  _int4buf = new byte[4];
}
origin: org.postgresql/postgresql

/**
 * Constructor: Connect to the PostgreSQL back end and return a stream connection.
 *
 * @param socketFactory socket factory to use when creating sockets
 * @param hostSpec the host and port to connect to
 * @param timeout timeout in milliseconds, or 0 if no timeout set
 * @throws IOException if an IOException occurs below it.
 */
public PGStream(SocketFactory socketFactory, HostSpec hostSpec, int timeout) throws IOException {
 this.socketFactory = socketFactory;
 this.hostSpec = hostSpec;
 Socket socket = socketFactory.createSocket();
 if (!socket.isConnected()) {
  // When using a SOCKS proxy, the host might not be resolvable locally,
  // thus we defer resolution until the traffic reaches the proxy. If there
  // is no proxy, we must resolve the host to an IP to connect the socket.
  InetSocketAddress address = hostSpec.shouldResolve()
    ? new InetSocketAddress(hostSpec.getHost(), hostSpec.getPort())
    : InetSocketAddress.createUnresolved(hostSpec.getHost(), hostSpec.getPort());
  socket.connect(address, timeout);
 }
 changeSocket(socket);
 setEncoding(Encoding.getJVMEncoding("UTF-8"));
 _int2buf = new byte[2];
 _int4buf = new byte[4];
}
origin: org.postgresql/postgresql

    value);
 pgStream.setEncoding(Encoding.getDatabaseEncoding(value));
} else if (!value.equalsIgnoreCase("UTF8") && !value.equalsIgnoreCase("UTF-8")) {
origin: postgresql/postgresql

pgStream.setEncoding(Encoding.getDatabaseEncoding("UTF8"));
origin: org.ancoron.postgresql/org.postgresql.osgi

void setEncoding(Encoding encoding) throws IOException {
  pgStream.setEncoding(encoding);
}
origin: org.ancoron.postgresql/org.postgresql

void setEncoding(Encoding encoding) throws IOException {
  pgStream.setEncoding(encoding);
}
origin: org.ancoron.postgresql/org.postgresql

/**
 * Switch this stream to using a new socket. Any existing socket
 * is <em>not</em> closed; it's assumed that we are changing to
 * a new socket that delegates to the original socket (e.g. SSL).
 *
 * @param socket the new socket to change to
 * @throws IOException if something goes wrong
 */
public void changeSocket(Socket socket) throws IOException {
  this.connection = socket;
  // Submitted by Jason Venner <jason@idiom.com>. Disable Nagle
  // as we are selective about flushing output only when we
  // really need to.
  connection.setTcpNoDelay(true);
  // Buffer sizes submitted by Sverre H Huseby <sverrehu@online.no>
  pg_input = new VisibleBufferedInputStream(connection.getInputStream(), 8192);
  pg_output = new BufferedOutputStream(connection.getOutputStream(), 8192);
  if (encoding != null)
    setEncoding(encoding);
}
origin: org.ancoron.postgresql/org.postgresql.osgi

/**
 * Switch this stream to using a new socket. Any existing socket
 * is <em>not</em> closed; it's assumed that we are changing to
 * a new socket that delegates to the original socket (e.g. SSL).
 *
 * @param socket the new socket to change to
 * @throws IOException if something goes wrong
 */
public void changeSocket(Socket socket) throws IOException {
  this.connection = socket;
  // Submitted by Jason Venner <jason@idiom.com>. Disable Nagle
  // as we are selective about flushing output only when we
  // really need to.
  connection.setTcpNoDelay(true);
  // Buffer sizes submitted by Sverre H Huseby <sverrehu@online.no>
  pg_input = new VisibleBufferedInputStream(connection.getInputStream(), 8192);
  pg_output = new BufferedOutputStream(connection.getOutputStream(), 8192);
  if (encoding != null)
    setEncoding(encoding);
}
origin: org.ancoron.postgresql/org.postgresql.osgi

/**
 * Constructor:  Connect to the PostgreSQL back end and return
 * a stream connection.
 *
 * @param host the hostname to connect to
 * @param port the port number that the postmaster is sitting on
 * @exception IOException if an IOException occurs below it.
 */
public PGStream(String host, int port) throws IOException
{
  this.host = host;
  this.port = port;
  changeSocket(new Socket(host, port));
  setEncoding(Encoding.getJVMEncoding("US-ASCII"));
  _int2buf = new byte[2];
  _int4buf = new byte[4];
}
origin: org.ancoron.postgresql/org.postgresql

/**
 * Constructor:  Connect to the PostgreSQL back end and return
 * a stream connection.
 *
 * @param host the hostname to connect to
 * @param port the port number that the postmaster is sitting on
 * @exception IOException if an IOException occurs below it.
 */
public PGStream(String host, int port) throws IOException
{
  this.host = host;
  this.port = port;
  changeSocket(new Socket(host, port));
  setEncoding(Encoding.getJVMEncoding("US-ASCII"));
  _int2buf = new byte[2];
  _int4buf = new byte[4];
}
origin: org.ancoron.postgresql/org.postgresql

pgStream.setEncoding(Encoding.getDatabaseEncoding("UTF8"));
origin: org.ancoron.postgresql/org.postgresql.osgi

pgStream.setEncoding(Encoding.getDatabaseEncoding("UNICODE"));
org.postgresql.corePGStreamsetEncoding

Javadoc

Change the encoding used by this connection.

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
  • Receive
    Reads in a given number of bytes from the backend
  • ReceiveChar
    Receives a single character 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

  • Creating JSON documents from java classes using gson
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Option (scala)
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