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

How to use
Driver
in
org.apache.calcite.jdbc

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

origin: apache/nifi

@Override
protected void init(final ProcessorInitializationContext context) {
  try {
    DriverManager.registerDriver(new org.apache.calcite.jdbc.Driver());
  } catch (final SQLException e) {
    throw new ProcessException("Failed to load Calcite JDBC Driver", e);
  }
  final List<PropertyDescriptor> properties = new ArrayList<>();
  properties.add(RECORD_READER_FACTORY);
  properties.add(RECORD_WRITER_FACTORY);
  properties.add(INCLUDE_ZERO_RECORD_FLOWFILES);
  properties.add(CACHE_SCHEMA);
  this.properties = Collections.unmodifiableList(properties);
  relationships.add(REL_FAILURE);
  relationships.add(REL_ORIGINAL);
}
origin: Qihoo360/Quicksql

/** Test case for
 * <a href="https://issues.apache.org/jira/browse/CALCITE-281">[CALCITE-1919]
 * NPE when target in ReflectiveSchema belongs to the unnamed package</a>. */
@Test public void testReflectiveSchemaInUnnamedPackage() throws Exception {
 final Driver driver = new Driver();
 try (CalciteConnection connection = (CalciteConnection)
   driver.connect("jdbc:calcite:", new Properties())) {
  SchemaPlus rootSchema = connection.getRootSchema();
  final Class<?> c = Class.forName("RootHr");
  final Object o = c.getDeclaredConstructor().newInstance();
  rootSchema.add("hr", new ReflectiveSchema(o));
  connection.setSchema("hr");
  final Statement statement = connection.createStatement();
  final String sql = "select * from \"emps\"";
  final ResultSet resultSet = statement.executeQuery(sql);
  final String expected = "empid=100; name=Bill\n"
    + "empid=200; name=Eric\n"
    + "empid=150; name=Sebastian\n";
  assertThat(CalciteAssert.toString(resultSet), is(expected));
 }
}
origin: Qihoo360/Quicksql

/** A trojan-horse method, subject to change without notice. */
@VisibleForTesting
public static CalciteConnection connect(CalciteSchema schema,
  JavaTypeFactory typeFactory) {
 return DRIVER.connect(schema, typeFactory);
}
origin: Qihoo360/Quicksql

public Driver() {
 super();
 this.prepareFactory = createPrepareFactory();
}
origin: org.apache.calcite/calcite-core

/** Test case for
 * <a href="https://issues.apache.org/jira/browse/CALCITE-281">[CALCITE-1919]
 * NPE when target in ReflectiveSchema belongs to the unnamed package</a>. */
@Test public void testReflectiveSchemaInUnnamedPackage() throws Exception {
 final Driver driver = new Driver();
 try (CalciteConnection connection = (CalciteConnection)
   driver.connect("jdbc:calcite:", new Properties())) {
  SchemaPlus rootSchema = connection.getRootSchema();
  final Class<?> c = Class.forName("RootHr");
  final Object o = c.getDeclaredConstructor().newInstance();
  rootSchema.add("hr", new ReflectiveSchema(o));
  connection.setSchema("hr");
  final Statement statement = connection.createStatement();
  final String sql = "select * from \"emps\"";
  final ResultSet resultSet = statement.executeQuery(sql);
  final String expected = "empid=100; name=Bill\n"
    + "empid=200; name=Eric\n"
    + "empid=150; name=Sebastian\n";
  assertThat(CalciteAssert.toString(resultSet), is(expected));
 }
}
origin: org.apache.calcite/calcite-core

/** A trojan-horse method, subject to change without notice. */
@VisibleForTesting
public static CalciteConnection connect(CalciteSchema schema,
  JavaTypeFactory typeFactory) {
 return DRIVER.connect(schema, typeFactory);
}
origin: org.apache.calcite/calcite-core

public Driver() {
 super();
 this.prepareFactory = createPrepareFactory();
}
origin: Qihoo360/Quicksql

final Driver driver = new Driver();
CalciteConnection connection = (CalciteConnection)
  driver.connect("jdbc:calcite:", new Properties());
SchemaPlus rootSchema = connection.getRootSchema();
rootSchema.add("sale", new ReflectiveSchema(new Smalls.WideSaleSchema()));
origin: org.apache.nifi/nifi-standard-processors

@Override
protected void init(final ProcessorInitializationContext context) {
  try {
    DriverManager.registerDriver(new org.apache.calcite.jdbc.Driver());
  } catch (final SQLException e) {
    throw new ProcessException("Failed to load Calcite JDBC Driver", e);
  }
  final List<PropertyDescriptor> properties = new ArrayList<>();
  properties.add(RECORD_READER_FACTORY);
  properties.add(RECORD_WRITER_FACTORY);
  properties.add(INCLUDE_ZERO_RECORD_FLOWFILES);
  properties.add(CACHE_SCHEMA);
  this.properties = Collections.unmodifiableList(properties);
  relationships.add(REL_FAILURE);
  relationships.add(REL_ORIGINAL);
}
origin: org.apache.calcite/calcite-core

final Driver driver = new Driver();
CalciteConnection connection = (CalciteConnection)
  driver.connect("jdbc:calcite:", new Properties());
SchemaPlus rootSchema = connection.getRootSchema();
rootSchema.add("sale", new ReflectiveSchema(new Smalls.WideSaleSchema()));
origin: Qihoo360/Quicksql

final Driver driver = new Driver();
CalciteConnection connection = (CalciteConnection)
  driver.connect("jdbc:calcite:", new Properties());
SchemaPlus rootSchema = connection.getRootSchema();
rootSchema.add("hr", new ReflectiveSchema(new HrSchema()));
origin: org.apache.calcite/calcite-core

final Driver driver = new Driver();
CalciteConnection connection = (CalciteConnection)
  driver.connect("jdbc:calcite:", new Properties());
SchemaPlus rootSchema = connection.getRootSchema();
rootSchema.add("hr", new ReflectiveSchema(new HrSchema()));
org.apache.calcite.jdbcDriver

Javadoc

Calcite JDBC driver.

Most used methods

  • connect
    Creates an internal connection.
  • <init>
  • createPrepareFactory

Popular in Java

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • runOnUiThread (Activity)
  • setRequestProperty (URLConnection)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • From CI to AI: The AI layer in your organization
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