pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Postgresql jdbc driver for PG version 9.5
7+ messages / 3 participants
[nested] [flat]

* Postgresql jdbc driver for PG version 9.5
@ 2018-09-06 17:26  Poul Kristensen <bcc5226@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Poul Kristensen @ 2018-09-06 17:26 UTC (permalink / raw)
  To: pgsql-admin

Hi !
I am trying to use the jdbc driver in eclipse but get the following
How come?
if the driver is not org.postgresql.Driver,
which should I then use.

PostgreSQL JDBC Driver 42.2.5
Found in:
jar:file:/home/me/lib/postgresql-42.2.5.jar!/org/postgresql/Driver.class

The PgJDBC driver is not an executable Java program.

TIA
Poul
NB! Sorry if this is not the right list

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgresql jdbc driver for PG version 9.5
@ 2018-09-07 07:36  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Poul Kristensen <bcc5226@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Laurenz Albe @ 2018-09-07 07:36 UTC (permalink / raw)
  To: Poul Kristensen <bcc5226@gmail.com>; pgsql-jdbc@postgresql.org

Poul Kristensen wrote:
> I am trying to use the jdbc driver in eclipse but get the following 
> How come?
> if the driver is not org.postgresql.Driver,
> which should I then use. 
> 
> PostgreSQL JDBC Driver 42.2.5
> Found in: jar:file:/home/me/lib/postgresql-42.2.5.jar!/org/postgresql/Driver.class
> 
> The PgJDBC driver is not an executable Java program.

I have redirected the question to the JDBC list.

What does your code look like?

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgresql jdbc driver for PG version 9.5
@ 2018-09-07 09:32  Jorge Solórzano <jorsol@gmail.com>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 7+ messages in thread

From: Jorge Solórzano @ 2018-09-07 09:32 UTC (permalink / raw)
  To: List <pgsql-jdbc@postgresql.org>; +Cc: bcc5226@gmail.com

Hi Poul,

The jdbc driver is a library, if you run the jar file like java -jar
postgresql-42.2.5.jar, it will output that is not an executable Java
program.

You should use it following the conventions of JDBC API (
https://docs.oracle.com/javase/tutorial/jdbc/).

Regards,

On Fri, Sep 7, 2018 at 9:37 AM Laurenz Albe <laurenz.albe@cybertec.at>
wrote:

> Poul Kristensen wrote:
> > I am trying to use the jdbc driver in eclipse but get the following
> > How come?
> > if the driver is not org.postgresql.Driver,
> > which should I then use.
> >
> > PostgreSQL JDBC Driver 42.2.5
> > Found in:
> jar:file:/home/me/lib/postgresql-42.2.5.jar!/org/postgresql/Driver.class
> >
> > The PgJDBC driver is not an executable Java program.
>
> I have redirected the question to the JDBC list.
>
> What does your code look like?
>
> Yours,
> Laurenz Albe
> --
> Cybertec | https://www.cybertec-postgresql.com
>
>
>

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgresql jdbc driver for PG version 9.5
@ 2018-09-07 12:52  Poul Kristensen <bcc5226@gmail.com>
  parent: Jorge Solórzano <jorsol@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Poul Kristensen @ 2018-09-07 12:52 UTC (permalink / raw)
  To: jorsol@gmail.com; +Cc: pgsql-jdbc@postgresql.org

Hi Jorge
Thank you. Yes and it says:

DB.DRIVER The fully qualified class name of the JDBC driver. For Java DB,
this is org.apache.derby.jdbc.EmbeddedDriver. For MySQL, this is
com.mysql.jdbc.Driver.

How do I get org.postgresql.Driver to put in db.driver(e.g:
db.driver=org.postgresql.Driver)? That is my problem!

TIA
Poul


Den fre. 7. sep. 2018 kl. 11.33 skrev Jorge Solórzano <jorsol@gmail.com>:

> Hi Poul,
>
> The jdbc driver is a library, if you run the jar file like java -jar
> postgresql-42.2.5.jar, it will output that is not an executable Java
> program.
>
> You should use it following the conventions of JDBC API (
> https://docs.oracle.com/javase/tutorial/jdbc/).
>
> Regards,
>
> On Fri, Sep 7, 2018 at 9:37 AM Laurenz Albe <laurenz.albe@cybertec.at>
> wrote:
>
>> Poul Kristensen wrote:
>> > I am trying to use the jdbc driver in eclipse but get the following
>> > How come?
>> > if the driver is not org.postgresql.Driver,
>> > which should I then use.
>> >
>> > PostgreSQL JDBC Driver 42.2.5
>> > Found in:
>> jar:file:/home/me/lib/postgresql-42.2.5.jar!/org/postgresql/Driver.class
>> >
>> > The PgJDBC driver is not an executable Java program.
>>
>> I have redirected the question to the JDBC list.
>>
>> What does your code look like?
>>
>> Yours,
>> Laurenz Albe
>> --
>> Cybertec | https://www.cybertec-postgresql.com
>>
>>
>>

-- 
Med venlig hilsen / Best regards
Poul Kristensen
Linux-OS/Virtualizationexpert and Oracle DBA

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgresql jdbc driver for PG version 9.5
@ 2018-09-07 13:36  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Poul Kristensen <bcc5226@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Laurenz Albe @ 2018-09-07 13:36 UTC (permalink / raw)
  To: Poul Kristensen <bcc5226@gmail.com>; jorsol@gmail.com; +Cc: pgsql-jdbc@postgresql.org

Poul Kristensen wrote:
> Thank you. Yes and it says:
> 
> DB.DRIVER	The fully qualified class name of the JDBC driver. For Java DB, this is org.apache.derby.jdbc.EmbeddedDriver. For MySQL, this is com.mysql.jdbc.Driver.
> 
> How do I get org.postgresql.Driver to put in db.driver(e.g: db.driver=org.postgresql.Driver)? That is my problem! 

The documentation
(https://jdbc.postgresql.org/documentation/head/load.html)
has it:

  Prior to Java 1.6, the driver had to be loaded by the application - either by calling

  Class.forName("org.postgresql.Driver");

  or by passing the driver class name as a JVM parameter.

  java -Djdbc.drivers=org.postgresql.Driver example.ImageViewer

  These older methods of loading the driver are still supported but they are no longer necessary.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgresql jdbc driver for PG version 9.5
@ 2018-09-09 20:28  Poul Kristensen <bcc5226@gmail.com>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 7+ messages in thread

From: Poul Kristensen @ 2018-09-09 20:28 UTC (permalink / raw)
  To: laurenz.albe@cybertec.at; +Cc: Jorge Solórzano <jorsol@gmail.com>; pgsql-jdbc@postgresql.org

Hi and thank you for responding but I have to put a class as db.driver
value into  String driver and
then  loaded this way Class.forName(driver);
It works with the oracle driver.
I am using Postgresql JDBC Driver 42.2.25 and Driver.class eg:_
db.driver=Driver.class
but is rejected as not executable. It should be very simple. Does anyone
use the Driver.class?
TIA
Poul



Den fre. 7. sep. 2018 kl. 15.36 skrev Laurenz Albe <laurenz.albe@cybertec.at
>:

> Poul Kristensen wrote:
> > Thank you. Yes and it says:
> >
> > DB.DRIVER     The fully qualified class name of the JDBC driver. For
> Java DB, this is org.apache.derby.jdbc.EmbeddedDriver. For MySQL, this is
> com.mysql.jdbc.Driver.
> >
> > How do I get org.postgresql.Driver to put in db.driver(e.g:
> db.driver=org.postgresql.Driver)? That is my problem!
>
> The documentation
> (https://jdbc.postgresql.org/documentation/head/load.html)
> has it:
>
>   Prior to Java 1.6, the driver had to be loaded by the application -
> either by calling
>
>   Class.forName("org.postgresql.Driver");
>
>   or by passing the driver class name as a JVM parameter.
>
>   java -Djdbc.drivers=org.postgresql.Driver example.ImageViewer
>
>   These older methods of loading the driver are still supported but they
> are no longer necessary.
>
> Yours,
> Laurenz Albe
> --
> Cybertec | https://www.cybertec-postgresql.com
>
>

-- 
Med venlig hilsen / Best regards
Poul Kristensen
Linux-OS/Virtualizationexpert and Oracle DBA

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgresql jdbc driver for PG version 9.5
@ 2018-09-10 07:39  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Poul Kristensen <bcc5226@gmail.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Laurenz Albe @ 2018-09-10 07:39 UTC (permalink / raw)
  To: Poul Kristensen <bcc5226@gmail.com>; +Cc: Jorge Solórzano <jorsol@gmail.com>; pgsql-jdbc@postgresql.org

Poul Kristensen wrote:
> Hi and thank you for responding but I have to put a class as db.driver value into  String driver and
> then  loaded this way Class.forName(driver);
> It works with the oracle driver. 
> I am using Postgresql JDBC Driver 42.2.25 and Driver.class eg:_ db.driver=Driver.class 
> but is rejected as not executable. It should be very simple. Does anyone use the Driver.class?

I do it all the time, and it works just fine.

Just use "org.postgresql.Driver" as the driver class name and make
sure the JAR file is on your class path.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com





^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2018-09-10 07:39 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06 17:26 Postgresql jdbc driver for PG version 9.5 Poul Kristensen <bcc5226@gmail.com>
2018-09-07 07:36 ` Laurenz Albe <laurenz.albe@cybertec.at>
2018-09-07 09:32   ` Jorge Solórzano <jorsol@gmail.com>
2018-09-07 12:52     ` Poul Kristensen <bcc5226@gmail.com>
2018-09-07 13:36       ` Laurenz Albe <laurenz.albe@cybertec.at>
2018-09-09 20:28         ` Poul Kristensen <bcc5226@gmail.com>
2018-09-10 07:39           ` Laurenz Albe <laurenz.albe@cybertec.at>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox