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

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

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

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

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

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

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("sale", new ReflectiveSchema(new Smalls.WideSaleSchema()));
origin: Qihoo360/Quicksql

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

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

Javadoc

Creates an internal connection.

Popular methods of Driver

  • <init>
  • createPrepareFactory

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • getSharedPreferences (Context)
  • setContentView (Activity)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • 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