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

How to use
AvaticaSqlException
in
org.apache.calcite.avatica

Best Java code snippets using org.apache.calcite.avatica.AvaticaSqlException (Showing top 12 results out of 315)

origin: org.apache.calcite.avatica/avatica-core

@Override public void printStackTrace(PrintStream stream) {
 super.printStackTrace(stream);
 stream.flush();
 printServerStackTrace(new PrintStreamOrWriter(stream));
}
origin: apache/calcite-avatica

@Test public void testGetters() {
 final String msg = "My query failed!";
 final int code = 42;
 final String sql = "SELECT foo FROM bar;";
 final String stacktrace = "My Stack Trace";
 final String server = "localhost:8765";
 AvaticaSqlException e = new AvaticaSqlException(msg, sql, code, Arrays.asList(stacktrace),
   server);
 assertTrue(e.getMessage().contains(msg));
 assertEquals(code, e.getErrorCode());
 assertEquals(sql, e.getSQLState());
 assertEquals(1, e.getStackTraces().size());
 assertEquals(stacktrace, e.getStackTraces().get(0));
 assertEquals(server, e.getRemoteServer());
}
origin: org.apache.calcite/calcite-avatica

public SQLException createException(String message, String sql, Exception e) {
 if (e instanceof AvaticaClientRuntimeException) {
  // The AvaticaClientRuntimeException contains extra information about what/why
  // the exception was thrown that we can pass back to the user.
  AvaticaClientRuntimeException rte = (AvaticaClientRuntimeException) e;
  String serverAddress = null;
  if (null != rte.getRpcMetadata()) {
   serverAddress = rte.getRpcMetadata().serverAddress;
  }
  return new AvaticaSqlException(message, rte.getSqlState(), rte.getErrorCode(),
    rte.getServerExceptions(), serverAddress);
 }
 return new SQLException(message, e);
}
origin: org.apache.calcite.avatica/avatica-core

@Test public void testGetters() {
 final String msg = "My query failed!";
 final int code = 42;
 final String sql = "SELECT foo FROM bar;";
 final String stacktrace = "My Stack Trace";
 final String server = "localhost:8765";
 AvaticaSqlException e = new AvaticaSqlException(msg, sql, code, Arrays.asList(stacktrace),
   server);
 assertTrue(e.getMessage().contains(msg));
 assertEquals(code, e.getErrorCode());
 assertEquals(sql, e.getSQLState());
 assertEquals(1, e.getStackTraces().size());
 assertEquals(stacktrace, e.getStackTraces().get(0));
 assertEquals(server, e.getRemoteServer());
}
origin: org.apache.calcite.avatica/avatica-core

public SQLException createException(String message, String sql, Exception e) {
 if (e instanceof AvaticaClientRuntimeException) {
  // The AvaticaClientRuntimeException contains extra information about what/why
  // the exception was thrown that we can pass back to the user.
  AvaticaClientRuntimeException rte = (AvaticaClientRuntimeException) e;
  String serverAddress = null;
  if (null != rte.getRpcMetadata()) {
   serverAddress = rte.getRpcMetadata().serverAddress;
  }
  return new AvaticaSqlException(message, rte.getSqlState(), rte.getErrorCode(),
    rte.getServerExceptions(), serverAddress);
 }
 return new SQLException(message, e);
}
origin: org.apache.calcite/calcite-avatica

@Test public void testGetters() {
 final String msg = "My query failed!";
 final int code = 42;
 final String sql = "SELECT foo FROM bar;";
 final String stacktrace = "My Stack Trace";
 final String server = "localhost:8765";
 AvaticaSqlException e = new AvaticaSqlException(msg, sql, code, Arrays.asList(stacktrace),
   server);
 assertTrue(e.getMessage().contains(msg));
 assertEquals(code, e.getErrorCode());
 assertEquals(sql, e.getSQLState());
 assertEquals(1, e.getStackTraces().size());
 assertEquals(stacktrace, e.getStackTraces().get(0));
 assertEquals(server, e.getRemoteServer());
}
origin: apache/calcite-avatica

public SQLException createException(String message, String sql, Exception e) {
 if (e instanceof AvaticaClientRuntimeException) {
  // The AvaticaClientRuntimeException contains extra information about what/why
  // the exception was thrown that we can pass back to the user.
  AvaticaClientRuntimeException rte = (AvaticaClientRuntimeException) e;
  String serverAddress = null;
  if (null != rte.getRpcMetadata()) {
   serverAddress = rte.getRpcMetadata().serverAddress;
  }
  return new AvaticaSqlException(message, rte.getSqlState(), rte.getErrorCode(),
    rte.getServerExceptions(), serverAddress);
 }
 return new SQLException(message, e);
}
origin: org.apache.calcite.avatica/avatica-core

@Override public void printStackTrace(PrintWriter writer) {
 super.printStackTrace(writer);
 writer.flush();
 printServerStackTrace(new PrintStreamOrWriter(writer));
}
origin: apache/calcite-avatica

@Override public void printStackTrace(PrintStream stream) {
 super.printStackTrace(stream);
 stream.flush();
 printServerStackTrace(new PrintStreamOrWriter(stream));
}
origin: apache/calcite-avatica

@Override public void printStackTrace(PrintWriter writer) {
 super.printStackTrace(writer);
 writer.flush();
 printServerStackTrace(new PrintStreamOrWriter(writer));
}
origin: org.apache.calcite/calcite-avatica

@Override public void printStackTrace(PrintStream stream) {
 super.printStackTrace(stream);
 stream.flush();
 printServerStackTrace(new PrintStreamOrWriter(stream));
}
origin: org.apache.calcite/calcite-avatica

@Override public void printStackTrace(PrintWriter writer) {
 super.printStackTrace(writer);
 writer.flush();
 printServerStackTrace(new PrintStreamOrWriter(writer));
}
org.apache.calcite.avaticaAvaticaSqlException

Javadoc

A client-facing SQLException which encapsulates errors from the remote Avatica server.

Most used methods

  • <init>
    Construct the Exception with information from the server.
  • getErrorCode
  • getMessage
  • getRemoteServer
  • getSQLState
  • getStackTraces
  • printServerStackTrace
  • getErrorMessage

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • getSharedPreferences (Context)
  • startActivity (Activity)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top PhpStorm plugins
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