Repository: incubator-drill Updated Branches: refs/heads/master c6ad592a6 -> cd6dd9c6f
DRILL-1409: DbVisualizer fails to connect to Drill using embedded jdbc driver Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/77155433 Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/77155433 Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/77155433 Branch: refs/heads/master Commit: 771554335cc3be8329c240baf35c60f4c858faf1 Parents: dd9fce0 Author: Aditya Kishore <adi...@maprtech.com> Authored: Sat Sep 13 23:02:02 2014 -0700 Committer: Aditya Kishore <adi...@maprtech.com> Committed: Thu Oct 9 13:59:13 2014 -0700 ---------------------------------------------------------------------- .../apache/drill/jdbc/DrillConnectionImpl.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/77155433/exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillConnectionImpl.java ---------------------------------------------------------------------- diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillConnectionImpl.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillConnectionImpl.java index f318227..4c54780 100644 --- a/exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillConnectionImpl.java +++ b/exec/jdbc/src/main/java/org/apache/drill/jdbc/DrillConnectionImpl.java @@ -48,7 +48,6 @@ abstract class DrillConnectionImpl extends AvaticaConnection implements org.apac public final DrillStatementRegistry registry = new DrillStatementRegistry(); final DrillConnectionConfig config; - static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillConnection.class); private final DrillClient client; @@ -56,14 +55,18 @@ abstract class DrillConnectionImpl extends AvaticaConnection implements org.apac private Drillbit bit; private RemoteServiceSet serviceSet; - protected DrillConnectionImpl(Driver driver, AvaticaFactory factory, String url, Properties info) throws SQLException{ + protected DrillConnectionImpl(Driver driver, AvaticaFactory factory, String url, Properties info) throws SQLException { super(driver, factory, url, info); this.config = new DrillConnectionConfig(info); - - - try{ + try { if (config.isLocal()) { + try { + Class.forName("org.eclipse.jetty.server.Handler"); + } catch (ClassNotFoundException e1) { + throw new SQLException("Running Drill in embedded mode using the JDBC jar alone is not supported."); + } + DrillConfig dConfig = DrillConfig.create(); this.allocator = new TopLevelAllocator(dConfig); RemoteServiceSet set = GlobalServiceSetReference.SETS.get(); @@ -72,8 +75,8 @@ abstract class DrillConnectionImpl extends AvaticaConnection implements org.apac serviceSet = RemoteServiceSet.getLocalServiceSet(); set = serviceSet; try { - bit = new Drillbit(dConfig, serviceSet); - bit.run(); + bit = new Drillbit(dConfig, serviceSet); + bit.run(); } catch (Exception e) { throw new SQLException("Failure while attempting to start Drillbit in embedded mode.", e); } @@ -94,7 +97,6 @@ abstract class DrillConnectionImpl extends AvaticaConnection implements org.apac } } - @Override public DrillConnectionConfig config() { return config; @@ -171,4 +173,5 @@ abstract class DrillConnectionImpl extends AvaticaConnection implements org.apac } } } + }