You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by Sudip Mukherjee <sm...@commvault.com> on 2016/09/06 16:53:26 UTC

Load JDBC service ServiceLoader

Hi,
I am trying out a java program where I want to load drill JDBC driver using ServiceLoader.load like all other jdbc drivers. But the code is failing to load org.apache.drill.jdbc.Driver class. One possible reason
Is that the drill jdbc driver jar doesn't have a java.sql.Driver file under META_INF/services which is common for all the other driver jars.

Can the drill jdbc driver jar come with the driver file?

Thanks,
Sudip

RE: Load JDBC service ServiceLoader

Posted by Sudip Mukherjee <sm...@commvault.com>.
Hi Laurent,
Thanks for your comment. I've created a Jira DRILL-4880.

Sudip

-----Original Message-----
From: Laurent Goujon [mailto:laurent@dremio.com] 
Sent: Wednesday, September 07, 2016 4:33 AM
To: dev@drill.apache.org
Subject: Re: Load JDBC service ServiceLoader

That sounds like a good idea. The JDBC example has a
Class.forName("org.apache.drill.jdbc.Driver") statement to force driver registration, but a ServiceLoader registration is pretty standard. Maybe you should open a bug for it?

Laurent

On Tue, Sep 6, 2016 at 9:53 AM, Sudip Mukherjee <sm...@commvault.com>
wrote:

> Hi,
> I am trying out a java program where I want to load drill JDBC driver 
> using ServiceLoader.load like all other jdbc drivers. But the code is 
> failing to load org.apache.drill.jdbc.Driver class. One possible 
> reason Is that the drill jdbc driver jar doesn't have a 
> java.sql.Driver file under META_INF/services which is common for all the other driver jars.
>
> Can the drill jdbc driver jar come with the driver file?
>
> Thanks,
> Sudip
>

Re: Load JDBC service ServiceLoader

Posted by Laurent Goujon <la...@dremio.com>.
That sounds like a good idea. The JDBC example has a
Class.forName("org.apache.drill.jdbc.Driver") statement to force driver
registration, but a ServiceLoader registration is pretty standard. Maybe
you should open a bug for it?

Laurent

On Tue, Sep 6, 2016 at 9:53 AM, Sudip Mukherjee <sm...@commvault.com>
wrote:

> Hi,
> I am trying out a java program where I want to load drill JDBC driver
> using ServiceLoader.load like all other jdbc drivers. But the code is
> failing to load org.apache.drill.jdbc.Driver class. One possible reason
> Is that the drill jdbc driver jar doesn't have a java.sql.Driver file
> under META_INF/services which is common for all the other driver jars.
>
> Can the drill jdbc driver jar come with the driver file?
>
> Thanks,
> Sudip
>