Codota Logo
PgConnection.getEncoding
Code IndexAdd Codota to your IDE (free)

How to use
getEncoding
method
in
org.postgresql.jdbc.PgConnection

Best Java code snippets using org.postgresql.jdbc.PgConnection.getEncoding (Showing top 3 results out of 315)

  • Common ways to obtain PgConnection
private void myMethod () {
PgConnection p =
  • Codota IconConnection connection;connection.unwrap(PgConnection.class)
  • Smart code suggestions by Codota
}
origin: debezium/debezium

private Charset determineDatabaseCharset() {
  try {
    return Charset.forName(((PgConnection) connection()).getEncoding().name());
  }
  catch (SQLException e) {
    throw new RuntimeException("Couldn't obtain encoding for database " + database(), e);
  }
}
origin: org.postgresql/postgresql

@Override
public byte[] encodeString(String str) throws SQLException {
 try {
  return getEncoding().encode(str);
 } catch (IOException ioe) {
  throw new PSQLException(GT.tr("Unable to translate data into the desired encoding."),
    PSQLState.DATA_ERROR, ioe);
 }
}
origin: io.debezium/debezium-connector-postgres

private Charset determineDatabaseCharset() {
  try {
    return Charset.forName(((PgConnection) connection()).getEncoding().name());
  }
  catch (SQLException e) {
    throw new RuntimeException("Couldn't obtain encoding for database " + database(), e);
  }
}
org.postgresql.jdbcPgConnectiongetEncoding

Popular methods of PgConnection

  • close
    Note: even though Statement is automatically closed when it is garbage collected, it is better to cl
  • getServerMajorVersion
    Get server major version.
  • addDataType
  • createStatement
  • getCopyAPI
  • <init>
  • abort
  • addWarning
    This adds a warning to the warning chain.
  • appendArray
  • borrowCallableQuery
  • borrowQuery
  • borrowReturningQuery
  • borrowQuery,
  • borrowReturningQuery,
  • checkClosed,
  • commit,
  • createQuery,
  • createTypeInfo,
  • encodeString,
  • escapeString,
  • execSQLQuery

Popular in Java

  • Running tasks concurrently on multiple threads
  • compareTo (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
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