If you have the calcite-core jar on your class path the JDBC driver should be loaded automatically. So, check your class path.
> On May 18, 2017, at 1:38 AM, LogSplitter <[email protected]> wrote: > > Hi, > > I have been trying to use the Planner model to generate relational algebra > from calcite. > > Everything seemed to be going very well and from a stand alone program I can > call the planner and get back correct results. > > The test code is as follows: > > public static void main(String[] args){ > final SqlStdOperatorTable stdOpTab = SqlStdOperatorTable.instance(); > MYSchema mySchema = new MySchema("details", null); > final SchemaPlus rootSchema = Frameworks.createRootSchema(true); > final FrameworkConfig config = Frameworks.newConfigBuilder() > .defaultSchema(rootSchema.add("mine", mySchema)) > .operatorTable(stdOpTab) > .build(); > > Planner p = Frameworks.getPlanner(config); > > SqlNode parseR = null; > try { > parseR = p.parse("select c_custkey from customer limit 5"); > } catch (SqlParseException ex) { > Logger.getLogger(tester.class.getName()).log(Level.SEVERE, null, ex); > } > > SqlNode validateR = null; > try { > p.validate(parseR); > } catch (ValidationException ex) { > Logger.getLogger(tester.class.getName()).log(Level.SEVERE, null, ex); > } > RelRoot relR = null; > try { > relR = p.rel(validateR); > } catch (RelConversionException ex) { > Logger.getLogger(tester.class.getName()).log(Level.SEVERE, null, ex); > } > LOGGER.error ("Result was " + relR); > LOGGER.error ("Result project() " + relR.project()); > LOGGER.error ("Result project() " + > RelOptUtil.toString(relR.project())); > > } > > This all works fine, and I get the results I expect. > > When I place this identical code in a method in a more complex call path I > get an exception when trying to do the parse. > > The error is: > > Exception occurred: java.sql.SQLException: No suitable driver found for > jdbc:calcite: > > I am wondering if any one understands where this error is coming from? Its a > little unclear to me why it is looking for a driver at all? > > Any help with this would be much appreciated, looking forward to getting code > working with 1.12. > > regards >
