You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Anton Kravchenko <kr...@gmail.com> on 2016/10/14 17:30:22 UTC

Connecting to Drill Programmatically in embedded mode on Windows

Hi there,

Just to make sure, It looks like connecting to Drill Programmatically in
embedded mode is not supported on Windows (have not tested on Linux yet),
is that right?

'Exception in thread "main" java.sql.SQLNonTransientConnectionException:
Running Drill in embedded mode using Drill's jdbc-all JDBC driver Jar file
alone is not supported.'

import java.sql.*;
public class DrillJDBC {
    public static void main(String[] args) throws Exception {
Class.forName("org.apache.drill.jdbc.Driver");
Connection connection =DriverManager.getConnection("jdbc:drill:zk=local");
}
}

Thank you,
Anton

Re: Connecting to Drill Programmatically in embedded mode on Windows

Posted by Anton Kravchenko <kr...@gmail.com>.
ok, thanks. It seems to work after adding all jars from %DRILL_CP% to
%CLASSPATH%.

On Fri, Oct 14, 2016 at 10:53 AM, Chun Chang <cc...@maprtech.com> wrote:

> It should be possible. Take a look at how sqlline does it.
>
> On Fri, Oct 14, 2016 at 10:30 AM, Anton Kravchenko <
> kravchenko.anton86@gmail.com> wrote:
>
> > Hi there,
> >
> > Just to make sure, It looks like connecting to Drill Programmatically in
> > embedded mode is not supported on Windows (have not tested on Linux yet),
> > is that right?
> >
> > 'Exception in thread "main" java.sql.SQLNonTransientConnectionException:
> > Running Drill in embedded mode using Drill's jdbc-all JDBC driver Jar
> file
> > alone is not supported.'
> >
> > import java.sql.*;
> > public class DrillJDBC {
> >     public static void main(String[] args) throws Exception {
> > Class.forName("org.apache.drill.jdbc.Driver");
> > Connection connection =DriverManager.getConnection("
> jdbc:drill:zk=local");
> > }
> > }
> >
> > Thank you,
> > Anton
> >
>

Re: Connecting to Drill Programmatically in embedded mode on Windows

Posted by Chun Chang <cc...@maprtech.com>.
It should be possible. Take a look at how sqlline does it.

On Fri, Oct 14, 2016 at 10:30 AM, Anton Kravchenko <
kravchenko.anton86@gmail.com> wrote:

> Hi there,
>
> Just to make sure, It looks like connecting to Drill Programmatically in
> embedded mode is not supported on Windows (have not tested on Linux yet),
> is that right?
>
> 'Exception in thread "main" java.sql.SQLNonTransientConnectionException:
> Running Drill in embedded mode using Drill's jdbc-all JDBC driver Jar file
> alone is not supported.'
>
> import java.sql.*;
> public class DrillJDBC {
>     public static void main(String[] args) throws Exception {
> Class.forName("org.apache.drill.jdbc.Driver");
> Connection connection =DriverManager.getConnection("jdbc:drill:zk=local");
> }
> }
>
> Thank you,
> Anton
>