congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AvaticaSqlException.<init>
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using org.apache.calcite.avatica.AvaticaSqlException.<init> (Showing top 6 results out of 315)

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

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: 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/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

@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

@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());
}
org.apache.calcite.avaticaAvaticaSqlException<init>

Javadoc

Construct the Exception with information from the server.

Popular methods of AvaticaSqlException

  • getErrorCode
  • getMessage
  • getRemoteServer
  • getSQLState
  • getStackTraces
  • printServerStackTrace
  • getErrorMessage

Popular in Java

  • Parsing JSON documents to java classes using gson
  • startActivity (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • BoxLayout (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top Vim 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