Thread: Get PG version using JDBC?

Get PG version using JDBC?

From
David Wall
Date:
Is there a way to get the PG version string from JDBC?  I'm using PG 8.3.

Thanks,
David

Re: Get PG version using JDBC?

From
"Richard Broersma"
Date:
Select version();
                       version
-----------------------------------------------------
 PostgreSQL 8.3.3, compiled by Visual C++ build 1400
(1 row)

On Wed, Oct 15, 2008 at 2:01 PM, David Wall <d.wall@computer.org> wrote:
> Is there a way to get the PG version string from JDBC?  I'm using PG 8.3.
>
> Thanks,
> David
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

Re: Get PG version using JDBC?

From
Rodrigo Gonzalez
Date:
David Wall wrote:
> Is there a way to get the PG version string from JDBC?  I'm using PG 8.3.
>
> Thanks,
> David
>
SELECT version() ?

Re: Get PG version using JDBC?

From
Thomas Kellerer
Date:
David Wall wrote on 15.10.2008 23:01:
> Is there a way to get the PG version string from JDBC?  I'm using PG 8.3.
>
> Thanks,
> David
>
In a portable manner:

http://java.sun.com/j2se/1.5.0/docs/api/java/sql/DatabaseMetaData.html#getDatabaseProductName()
http://java.sun.com/j2se/1.5.0/docs/api/java/sql/DatabaseMetaData.html#getDatabaseProductVersion()

Althout that will not return the information "compiled by..." as the suggested
"select version()" does

Thomas