Codota Logo
AvaticaSqlException
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
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(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: org.apache.calcite/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));
}
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

  • Start an intent from android
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • JList (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
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