You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by Ayola Jayamaha <ra...@gmail.com> on 2015/07/21 16:32:10 UTC

Suitable driver for JDBC Phoenix

Hi,

I'm  getting an SQL Exception[1] when I'm adding the classpath[2]. I'm
currently working on the phoenix 4.5.0-SNAPSHOT. What suitable version?

Regards,
Nishani




[1] java.sql.SQLException: No suitable driver found for
jdbc:phoenix:localhost:2181
[2] -cp "phoenix-assembly/target/phoenix-4.5.0-SNAPSHOT-client.jar"
-- 
Best Regards,
Nishani Jayamaha
http://ayolajayamaha.blogspot.com/

Re: Suitable driver for JDBC Phoenix

Posted by James Taylor <ja...@apache.org>.
Nishani,
You'll need to register the driver. There are two ways to do this:
- auto register the driver by adding it to the java.sql.Driver file in the
resources directory (see
phoenix/phoenix-core/src/main/resources/java.sql.Driver).
- explicitly add a Class.forName("org.apache.phoenix.jdbc.PhoenixDriver")
call in your main method (or any other place that gets called during
initialization before you try to open a connection.

Thanks,
James

On Tue, Jul 21, 2015 at 7:32 AM, Ayola Jayamaha <ra...@gmail.com>
wrote:

> Hi,
>
> I'm  getting an SQL Exception[1] when I'm adding the classpath[2]. I'm
> currently working on the phoenix 4.5.0-SNAPSHOT. What suitable version?
>
> Regards,
> Nishani
>
>
>
>
> [1] java.sql.SQLException: No suitable driver found for
> jdbc:phoenix:localhost:2181
> [2] -cp "phoenix-assembly/target/phoenix-4.5.0-SNAPSHOT-client.jar"
> --
> Best Regards,
> Nishani Jayamaha
> http://ayolajayamaha.blogspot.com/
>