Thread: [JDBC] Postgis example TestAutoregister is not working due to missinggetVersion() from pgjdbc community jar
[JDBC] Postgis example TestAutoregister is not working due to missinggetVersion() from pgjdbc community jar
From
Fahar Abbas
Date:
Hi pgsql-jdbc community! Steps of EDB PostgreSQL9.6 installers download from EnterpriseDB website. ------ 1. Install JDK 7 on Linux 32 and Linux 64 and on mac install JDK 8 2. Install pgjdbc and postgis from (PostgreSQL) StackBuilder 3. Performs below commands from terminal: For Linux: ------------ export JAVA_HOME=/usr/local/jdk1.7.0_51/bin/java export PATH=/usr/local/jdk1.7.0_51/bin:$PATH export CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH export CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH For MAC: ---------- export JAVA_HOME="/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" export PATH="/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/":$PATH export CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH export CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH export CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH 4. Connect psql with postgres database. 5. <PG_HOME>/bin/psql -d postgres -p 5432 6. Create Postgis Extensions. CREATE EXTENSION Postgis; CREATE EXTENSION Postgis_topology; CREATE EXTENSION fuzzystrmatch; CREATE EXTENSION Postgis_tiger_geocoder; 7. Verify installed postgis extensions version through psql commands. SELECT postgis_version(); SELECT postgis_full_version(); SELECT postgis_lib_build_date(); SELECT postgis_scripts_installed(); 8. extract postgis-jdbc-2.1.7.2.jar file through jar xf 9. Now execute the example files and execute following query: java examples/TestAutoregister jdbc:postgresql://localhost:5432/postgres postgres postgres Expected Result: ---------------- Postgis jar Example executed successfully. Output: java examples/TestAutoregister jdbc:postgresql://localhost:5432/postgres postgres postgres Testing proper auto-registration Driver version: PostgreSQL 9.4 JDBC4.1 (build 1206) Creating JDBC connection to jdbc:postgresql://localhost:5432/postgres PostGIS Version: 2 PGgeometry successful! Box3d successful! Box2d successful! Finished. TestAutoregister.java finished without errors. Actual Result: -------------- java examples/TestAutoregister jdbc:postgresql://localhost:5432/postgres postgres postgres Testing proper auto-registration Exception in thread "main" java.lang.NoSuchMethodError: org.postgresql.Driver.getVersion()Ljava/lang/String; at examples.TestAutoregister.main(TestAutoregister.java:64) ------------ After complete investigation, I observed that getVersion information has been removed under community 42.jdbc.jar file however in postgis-jdbc-2.1.7.2.jar, we are still using getVersion. We(EDB PostgreSQL team) released last postgis-pg96-2.3.2-1 version on 15-Feb-2017 while community jdbc team removed getVersion from JDBC jar file from PostgreSQL JDBC Driver 42.0.0 version on 19-Feb-2017.(https://jdbc.postgresql.org/) Please note that we are shipping pgjdbc driver from https://jdbc.postgresql.org/download.html while postgis jdbc jar under this location: https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2 Please note that on 9.4.1212 version getVersion information is available but not available on 42.jdbc.jar file Kindly let us know if we are planning to fix that issue or not and we will modify our postgis accordingly? Kind Regards, -- Fahar Abbas QMG EnterpriseDB Corporation
Re: Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Dave Cramer
Date:
What do you need getVersion() for ?
Note there are:
@Override
public int getMajorVersion() {
return org.postgresql.util.DriverInfo.MAJOR_VERSION;
}
@Override
public int getMinorVersion() {
return org.postgresql.util.DriverInfo.MINOR_VERSION;
}
On 3 August 2017 at 21:44, Fahar Abbas <fahar.abbas@enterprisedb.com> wrote:
Hi pgsql-jdbc community!
Steps of EDB PostgreSQL9.6 installers download from EnterpriseDB website.
------
1. Install JDK 7 on Linux 32 and Linux 64 and on mac install JDK 8
2. Install pgjdbc and postgis from (PostgreSQL) StackBuilder
3. Performs below commands from terminal:
For Linux:
------------
export JAVA_HOME=/usr/local/jdk1.7.0_51/bin/java
export PATH=/usr/local/jdk1.7.0_51/bin:$PATH
export CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6. jar:/opt/PostgreSQL/9.6/ PostGIS/java/jdbc/postgis- jdbc-2.1.7.2.jar:$CLASSPATH
export CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7. jar:/opt/PostgreSQL/9.6/ PostGIS/java/jdbc/postgis- jdbc-2.1.7.2.jar:$CLASSPATH
For MAC:
----------
export JAVA_HOME="/Library/Internet\
Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java"
export PATH="/Library/Internet\
Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/":$ PATH
export CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql- 42.1.3.jar:/Library/ PostgreSQL/9.6/PostGIS/java/ jdbc/postgis-jdbc-2.1.7.2.jar: $CLASSPATH
export CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql- 42.1.3.jre6.jar:/Library/ PostgreSQL/9.6/PostGIS/java/ jdbc/postgis-jdbc-2.1.7.2.jar: $CLASSPATH
export CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql- 42.1.3.jre7.jar:/Library/ PostgreSQL/9.6/PostGIS/java/ jdbc/postgis-jdbc-2.1.7.2.jar: $CLASSPATH
4. Connect psql with postgres database.
5. <PG_HOME>/bin/psql -d postgres -p 5432
6. Create Postgis Extensions.
CREATE EXTENSION Postgis;
CREATE EXTENSION Postgis_topology;
CREATE EXTENSION fuzzystrmatch;
CREATE EXTENSION Postgis_tiger_geocoder;
7. Verify installed postgis extensions version through psql commands.
SELECT postgis_version();
SELECT postgis_full_version();
SELECT postgis_lib_build_date();
SELECT postgis_scripts_installed();
8. extract postgis-jdbc-2.1.7.2.jar file through jar xf
9. Now execute the example files and execute following query:
java examples/TestAutoregister
jdbc:postgresql://localhost:5432/postgres postgres postgres
Expected Result:
----------------
Postgis jar Example executed successfully.
Output:
java examples/TestAutoregister
jdbc:postgresql://localhost:5432/postgres postgres postgres
Testing proper auto-registration
Driver version: PostgreSQL 9.4 JDBC4.1 (build 1206)
Creating JDBC connection to jdbc:postgresql://localhost:5432/postgres
PostGIS Version: 2
PGgeometry successful!
Box3d successful!
Box2d successful!
Finished.
TestAutoregister.java finished without errors.
Actual Result:
--------------
java examples/TestAutoregister
jdbc:postgresql://localhost:5432/postgres postgres postgres
Testing proper auto-registration
Exception in thread "main" java.lang.NoSuchMethodError:
org.postgresql.Driver.getVersion()Ljava/lang/String;
at examples.TestAutoregister.main(TestAutoregister.java:64)
------------
After complete investigation, I observed that getVersion information
has been removed under community 42.jdbc.jar file however in
postgis-jdbc-2.1.7.2.jar, we are still using getVersion.
We(EDB PostgreSQL team) released last postgis-pg96-2.3.2-1 version on
15-Feb-2017 while community jdbc team removed getVersion from JDBC jar
file from PostgreSQL JDBC Driver 42.0.0 version on
19-Feb-2017.(https://jdbc.postgresql.org/)
Please note that we are shipping pgjdbc driver from
https://jdbc.postgresql.org/download.html while postgis jdbc jar under
this location: https://mvnrepository.com/artifact/net.postgis/postgis- jdbc/2.1.7.2
Please note that on 9.4.1212 version getVersion information is
available but not available on 42.jdbc.jar file
Kindly let us know if we are planning to fix that issue or not and we
will modify our postgis accordingly?
Kind Regards,
--
Fahar Abbas
QMG
EnterpriseDB Corporation
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
Re: [JDBC] Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Dave Cramer
Date:
What do you need getVersion() for ?
Note there are:
@Override
public int getMajorVersion() {
return org.postgresql.util.DriverInfo.MAJOR_VERSION;
}
@Override
public int getMinorVersion() {
return org.postgresql.util.DriverInfo.MINOR_VERSION;
}
On 3 August 2017 at 21:44, Fahar Abbas <fahar.abbas@enterprisedb.com> wrote:
Hi pgsql-jdbc community!
Steps of EDB PostgreSQL9.6 installers download from EnterpriseDB website.
------
1. Install JDK 7 on Linux 32 and Linux 64 and on mac install JDK 8
2. Install pgjdbc and postgis from (PostgreSQL) StackBuilder
3. Performs below commands from terminal:
For Linux:
------------
export JAVA_HOME=/usr/local/jdk1.7.0_51/bin/java
export PATH=/usr/local/jdk1.7.0_51/bin:$PATH
export CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6. jar:/opt/PostgreSQL/9.6/ PostGIS/java/jdbc/postgis- jdbc-2.1.7.2.jar:$CLASSPATH
export CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7. jar:/opt/PostgreSQL/9.6/ PostGIS/java/jdbc/postgis- jdbc-2.1.7.2.jar:$CLASSPATH
For MAC:
----------
export JAVA_HOME="/Library/Internet\
Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java"
export PATH="/Library/Internet\
Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/":$ PATH
export CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql- 42.1.3.jar:/Library/ PostgreSQL/9.6/PostGIS/java/ jdbc/postgis-jdbc-2.1.7.2.jar: $CLASSPATH
export CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql- 42.1.3.jre6.jar:/Library/ PostgreSQL/9.6/PostGIS/java/ jdbc/postgis-jdbc-2.1.7.2.jar: $CLASSPATH
export CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql- 42.1.3.jre7.jar:/Library/ PostgreSQL/9.6/PostGIS/java/ jdbc/postgis-jdbc-2.1.7.2.jar: $CLASSPATH
4. Connect psql with postgres database.
5. <PG_HOME>/bin/psql -d postgres -p 5432
6. Create Postgis Extensions.
CREATE EXTENSION Postgis;
CREATE EXTENSION Postgis_topology;
CREATE EXTENSION fuzzystrmatch;
CREATE EXTENSION Postgis_tiger_geocoder;
7. Verify installed postgis extensions version through psql commands.
SELECT postgis_version();
SELECT postgis_full_version();
SELECT postgis_lib_build_date();
SELECT postgis_scripts_installed();
8. extract postgis-jdbc-2.1.7.2.jar file through jar xf
9. Now execute the example files and execute following query:
java examples/TestAutoregister
jdbc:postgresql://localhost:5432/postgres postgres postgres
Expected Result:
----------------
Postgis jar Example executed successfully.
Output:
java examples/TestAutoregister
jdbc:postgresql://localhost:5432/postgres postgres postgres
Testing proper auto-registration
Driver version: PostgreSQL 9.4 JDBC4.1 (build 1206)
Creating JDBC connection to jdbc:postgresql://localhost:5432/postgres
PostGIS Version: 2
PGgeometry successful!
Box3d successful!
Box2d successful!
Finished.
TestAutoregister.java finished without errors.
Actual Result:
--------------
java examples/TestAutoregister
jdbc:postgresql://localhost:5432/postgres postgres postgres
Testing proper auto-registration
Exception in thread "main" java.lang.NoSuchMethodError:
org.postgresql.Driver.getVersion()Ljava/lang/String;
at examples.TestAutoregister.main(TestAutoregister.java:64)
------------
After complete investigation, I observed that getVersion information
has been removed under community 42.jdbc.jar file however in
postgis-jdbc-2.1.7.2.jar, we are still using getVersion.
We(EDB PostgreSQL team) released last postgis-pg96-2.3.2-1 version on
15-Feb-2017 while community jdbc team removed getVersion from JDBC jar
file from PostgreSQL JDBC Driver 42.0.0 version on
19-Feb-2017.(https://jdbc.postgresql.org/)
Please note that we are shipping pgjdbc driver from
https://jdbc.postgresql.org/download.html while postgis jdbc jar under
this location: https://mvnrepository.com/artifact/net.postgis/postgis- jdbc/2.1.7.2
Please note that on 9.4.1212 version getVersion information is
available but not available on 42.jdbc.jar file
Kindly let us know if we are planning to fix that issue or not and we
will modify our postgis accordingly?
Kind Regards,
--
Fahar Abbas
QMG
EnterpriseDB Corporation
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
Re: Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Fahar Abbas
Date:
On Fri, Aug 4, 2017 at 9:51 AM, Dave Cramer <pg@fastcrypt.com> wrote: > What do you need getVersion() for ? https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2 On the above link if we extract postgis-jdbc-2.1.7.2.jar and this contain example TestAutoregister and getVersion is part of it. > > Note there are: > > @Override > public int getMajorVersion() { > return org.postgresql.util.DriverInfo.MAJOR_VERSION; > } > > @Override > public int getMinorVersion() { > return org.postgresql.util.DriverInfo.MINOR_VERSION; > } > > > > Dave Cramer > > davec@postgresintl.com > www.postgresintl.com > > On 3 August 2017 at 21:44, Fahar Abbas <fahar.abbas@enterprisedb.com> wrote: >> >> Hi pgsql-jdbc community! >> >> Steps of EDB PostgreSQL9.6 installers download from EnterpriseDB website. >> >> ------ >> 1. Install JDK 7 on Linux 32 and Linux 64 and on mac install JDK 8 >> 2. Install pgjdbc and postgis from (PostgreSQL) StackBuilder >> 3. Performs below commands from terminal: >> >> For Linux: >> ------------ >> export JAVA_HOME=/usr/local/jdk1.7.0_51/bin/java >> export PATH=/usr/local/jdk1.7.0_51/bin:$PATH >> export >> CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >> export >> CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >> >> For MAC: >> ---------- >> export JAVA_HOME="/Library/Internet\ >> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" >> export PATH="/Library/Internet\ >> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/":$PATH >> export >> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >> export >> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >> export >> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >> >> 4. Connect psql with postgres database. >> >> 5. <PG_HOME>/bin/psql -d postgres -p 5432 >> >> 6. Create Postgis Extensions. >> >> CREATE EXTENSION Postgis; >> CREATE EXTENSION Postgis_topology; >> CREATE EXTENSION fuzzystrmatch; >> CREATE EXTENSION Postgis_tiger_geocoder; >> >> 7. Verify installed postgis extensions version through psql commands. >> >> SELECT postgis_version(); >> SELECT postgis_full_version(); >> SELECT postgis_lib_build_date(); >> SELECT postgis_scripts_installed(); >> >> 8. extract postgis-jdbc-2.1.7.2.jar file through jar xf >> 9. Now execute the example files and execute following query: >> >> java examples/TestAutoregister >> jdbc:postgresql://localhost:5432/postgres postgres postgres >> >> Expected Result: >> ---------------- >> Postgis jar Example executed successfully. >> >> Output: >> >> java examples/TestAutoregister >> jdbc:postgresql://localhost:5432/postgres postgres postgres >> Testing proper auto-registration >> Driver version: PostgreSQL 9.4 JDBC4.1 (build 1206) >> Creating JDBC connection to jdbc:postgresql://localhost:5432/postgres >> PostGIS Version: 2 >> PGgeometry successful! >> Box3d successful! >> Box2d successful! >> Finished. >> TestAutoregister.java finished without errors. >> >> Actual Result: >> -------------- >> java examples/TestAutoregister >> jdbc:postgresql://localhost:5432/postgres postgres postgres >> Testing proper auto-registration >> Exception in thread "main" java.lang.NoSuchMethodError: >> org.postgresql.Driver.getVersion()Ljava/lang/String; >> at examples.TestAutoregister.main(TestAutoregister.java:64) >> ------------ >> >> After complete investigation, I observed that getVersion information >> has been removed under community 42.jdbc.jar file however in >> postgis-jdbc-2.1.7.2.jar, we are still using getVersion. >> >> We(EDB PostgreSQL team) released last postgis-pg96-2.3.2-1 version on >> 15-Feb-2017 while community jdbc team removed getVersion from JDBC jar >> file from PostgreSQL JDBC Driver 42.0.0 version on >> 19-Feb-2017.(https://jdbc.postgresql.org/) >> >> >> Please note that we are shipping pgjdbc driver from >> https://jdbc.postgresql.org/download.html while postgis jdbc jar under >> this location: >> https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2 >> >> Please note that on 9.4.1212 version getVersion information is >> available but not available on 42.jdbc.jar file >> >> Kindly let us know if we are planning to fix that issue or not and we >> will modify our postgis accordingly? >> >> Kind Regards, >> -- >> Fahar Abbas >> QMG >> EnterpriseDB Corporation >> >> >> -- >> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) >> To make changes to your subscription: >> http://www.postgresql.org/mailpref/pgsql-jdbc > > -- Fahar Abbas QMG EnterpriseDB Corporation
Re: [JDBC] Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Fahar Abbas
Date:
On Fri, Aug 4, 2017 at 9:51 AM, Dave Cramer <pg@fastcrypt.com> wrote: > What do you need getVersion() for ? https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2 On the above link if we extract postgis-jdbc-2.1.7.2.jar and this contain example TestAutoregister and getVersion is part of it. > > Note there are: > > @Override > public int getMajorVersion() { > return org.postgresql.util.DriverInfo.MAJOR_VERSION; > } > > @Override > public int getMinorVersion() { > return org.postgresql.util.DriverInfo.MINOR_VERSION; > } > > > > Dave Cramer > > davec@postgresintl.com > www.postgresintl.com > > On 3 August 2017 at 21:44, Fahar Abbas <fahar.abbas@enterprisedb.com> wrote: >> >> Hi pgsql-jdbc community! >> >> Steps of EDB PostgreSQL9.6 installers download from EnterpriseDB website. >> >> ------ >> 1. Install JDK 7 on Linux 32 and Linux 64 and on mac install JDK 8 >> 2. Install pgjdbc and postgis from (PostgreSQL) StackBuilder >> 3. Performs below commands from terminal: >> >> For Linux: >> ------------ >> export JAVA_HOME=/usr/local/jdk1.7.0_51/bin/java >> export PATH=/usr/local/jdk1.7.0_51/bin:$PATH >> export >> CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >> export >> CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >> >> For MAC: >> ---------- >> export JAVA_HOME="/Library/Internet\ >> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" >> export PATH="/Library/Internet\ >> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/":$PATH >> export >> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >> export >> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >> export >> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >> >> 4. Connect psql with postgres database. >> >> 5. <PG_HOME>/bin/psql -d postgres -p 5432 >> >> 6. Create Postgis Extensions. >> >> CREATE EXTENSION Postgis; >> CREATE EXTENSION Postgis_topology; >> CREATE EXTENSION fuzzystrmatch; >> CREATE EXTENSION Postgis_tiger_geocoder; >> >> 7. Verify installed postgis extensions version through psql commands. >> >> SELECT postgis_version(); >> SELECT postgis_full_version(); >> SELECT postgis_lib_build_date(); >> SELECT postgis_scripts_installed(); >> >> 8. extract postgis-jdbc-2.1.7.2.jar file through jar xf >> 9. Now execute the example files and execute following query: >> >> java examples/TestAutoregister >> jdbc:postgresql://localhost:5432/postgres postgres postgres >> >> Expected Result: >> ---------------- >> Postgis jar Example executed successfully. >> >> Output: >> >> java examples/TestAutoregister >> jdbc:postgresql://localhost:5432/postgres postgres postgres >> Testing proper auto-registration >> Driver version: PostgreSQL 9.4 JDBC4.1 (build 1206) >> Creating JDBC connection to jdbc:postgresql://localhost:5432/postgres >> PostGIS Version: 2 >> PGgeometry successful! >> Box3d successful! >> Box2d successful! >> Finished. >> TestAutoregister.java finished without errors. >> >> Actual Result: >> -------------- >> java examples/TestAutoregister >> jdbc:postgresql://localhost:5432/postgres postgres postgres >> Testing proper auto-registration >> Exception in thread "main" java.lang.NoSuchMethodError: >> org.postgresql.Driver.getVersion()Ljava/lang/String; >> at examples.TestAutoregister.main(TestAutoregister.java:64) >> ------------ >> >> After complete investigation, I observed that getVersion information >> has been removed under community 42.jdbc.jar file however in >> postgis-jdbc-2.1.7.2.jar, we are still using getVersion. >> >> We(EDB PostgreSQL team) released last postgis-pg96-2.3.2-1 version on >> 15-Feb-2017 while community jdbc team removed getVersion from JDBC jar >> file from PostgreSQL JDBC Driver 42.0.0 version on >> 19-Feb-2017.(https://jdbc.postgresql.org/) >> >> >> Please note that we are shipping pgjdbc driver from >> https://jdbc.postgresql.org/download.html while postgis jdbc jar under >> this location: >> https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2 >> >> Please note that on 9.4.1212 version getVersion information is >> available but not available on 42.jdbc.jar file >> >> Kindly let us know if we are planning to fix that issue or not and we >> will modify our postgis accordingly? >> >> Kind Regards, >> -- >> Fahar Abbas >> QMG >> EnterpriseDB Corporation >> >> >> -- >> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) >> To make changes to your subscription: >> http://www.postgresql.org/mailpref/pgsql-jdbc > > -- Fahar Abbas QMG EnterpriseDB Corporation
Re: Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Fahar Abbas
Date:
We can not execute TestAutoregister due to missing getVersion under jdbc.jar file. On Fri, Aug 4, 2017 at 10:01 AM, Fahar Abbas <fahar.abbas@enterprisedb.com> wrote: > On Fri, Aug 4, 2017 at 9:51 AM, Dave Cramer <pg@fastcrypt.com> wrote: >> What do you need getVersion() for ? > https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2 > > On the above link if we extract postgis-jdbc-2.1.7.2.jar and this > contain example TestAutoregister and getVersion is part of it. > > >> >> Note there are: >> >> @Override >> public int getMajorVersion() { >> return org.postgresql.util.DriverInfo.MAJOR_VERSION; >> } >> >> @Override >> public int getMinorVersion() { >> return org.postgresql.util.DriverInfo.MINOR_VERSION; >> } >> >> >> >> Dave Cramer >> >> davec@postgresintl.com >> www.postgresintl.com >> >> On 3 August 2017 at 21:44, Fahar Abbas <fahar.abbas@enterprisedb.com> wrote: >>> >>> Hi pgsql-jdbc community! >>> >>> Steps of EDB PostgreSQL9.6 installers download from EnterpriseDB website. >>> >>> ------ >>> 1. Install JDK 7 on Linux 32 and Linux 64 and on mac install JDK 8 >>> 2. Install pgjdbc and postgis from (PostgreSQL) StackBuilder >>> 3. Performs below commands from terminal: >>> >>> For Linux: >>> ------------ >>> export JAVA_HOME=/usr/local/jdk1.7.0_51/bin/java >>> export PATH=/usr/local/jdk1.7.0_51/bin:$PATH >>> export >>> CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>> export >>> CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>> >>> For MAC: >>> ---------- >>> export JAVA_HOME="/Library/Internet\ >>> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" >>> export PATH="/Library/Internet\ >>> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/":$PATH >>> export >>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>> export >>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>> export >>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>> >>> 4. Connect psql with postgres database. >>> >>> 5. <PG_HOME>/bin/psql -d postgres -p 5432 >>> >>> 6. Create Postgis Extensions. >>> >>> CREATE EXTENSION Postgis; >>> CREATE EXTENSION Postgis_topology; >>> CREATE EXTENSION fuzzystrmatch; >>> CREATE EXTENSION Postgis_tiger_geocoder; >>> >>> 7. Verify installed postgis extensions version through psql commands. >>> >>> SELECT postgis_version(); >>> SELECT postgis_full_version(); >>> SELECT postgis_lib_build_date(); >>> SELECT postgis_scripts_installed(); >>> >>> 8. extract postgis-jdbc-2.1.7.2.jar file through jar xf >>> 9. Now execute the example files and execute following query: >>> >>> java examples/TestAutoregister >>> jdbc:postgresql://localhost:5432/postgres postgres postgres >>> >>> Expected Result: >>> ---------------- >>> Postgis jar Example executed successfully. >>> >>> Output: >>> >>> java examples/TestAutoregister >>> jdbc:postgresql://localhost:5432/postgres postgres postgres >>> Testing proper auto-registration >>> Driver version: PostgreSQL 9.4 JDBC4.1 (build 1206) >>> Creating JDBC connection to jdbc:postgresql://localhost:5432/postgres >>> PostGIS Version: 2 >>> PGgeometry successful! >>> Box3d successful! >>> Box2d successful! >>> Finished. >>> TestAutoregister.java finished without errors. >>> >>> Actual Result: >>> -------------- >>> java examples/TestAutoregister >>> jdbc:postgresql://localhost:5432/postgres postgres postgres >>> Testing proper auto-registration >>> Exception in thread "main" java.lang.NoSuchMethodError: >>> org.postgresql.Driver.getVersion()Ljava/lang/String; >>> at examples.TestAutoregister.main(TestAutoregister.java:64) >>> ------------ >>> >>> After complete investigation, I observed that getVersion information >>> has been removed under community 42.jdbc.jar file however in >>> postgis-jdbc-2.1.7.2.jar, we are still using getVersion. >>> >>> We(EDB PostgreSQL team) released last postgis-pg96-2.3.2-1 version on >>> 15-Feb-2017 while community jdbc team removed getVersion from JDBC jar >>> file from PostgreSQL JDBC Driver 42.0.0 version on >>> 19-Feb-2017.(https://jdbc.postgresql.org/) >>> >>> >>> Please note that we are shipping pgjdbc driver from >>> https://jdbc.postgresql.org/download.html while postgis jdbc jar under >>> this location: >>> https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2 >>> >>> Please note that on 9.4.1212 version getVersion information is >>> available but not available on 42.jdbc.jar file >>> >>> Kindly let us know if we are planning to fix that issue or not and we >>> will modify our postgis accordingly? >>> >>> Kind Regards, >>> -- >>> Fahar Abbas >>> QMG >>> EnterpriseDB Corporation >>> >>> >>> -- >>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) >>> To make changes to your subscription: >>> http://www.postgresql.org/mailpref/pgsql-jdbc >> >> > > > > -- > Fahar Abbas > QMG > EnterpriseDB Corporation -- Fahar Abbas QMG EnterpriseDB Corporation Phone Office: +92-51-835-8874 Phone Direct: +92-51-8466803 Mobile: +92-333-5409707 Skype ID: syed.fahar.abbas Website: www.enterprisedb.com
Re: [JDBC] Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Fahar Abbas
Date:
We can not execute TestAutoregister due to missing getVersion under jdbc.jar file. On Fri, Aug 4, 2017 at 10:01 AM, Fahar Abbas <fahar.abbas@enterprisedb.com> wrote: > On Fri, Aug 4, 2017 at 9:51 AM, Dave Cramer <pg@fastcrypt.com> wrote: >> What do you need getVersion() for ? > https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2 > > On the above link if we extract postgis-jdbc-2.1.7.2.jar and this > contain example TestAutoregister and getVersion is part of it. > > >> >> Note there are: >> >> @Override >> public int getMajorVersion() { >> return org.postgresql.util.DriverInfo.MAJOR_VERSION; >> } >> >> @Override >> public int getMinorVersion() { >> return org.postgresql.util.DriverInfo.MINOR_VERSION; >> } >> >> >> >> Dave Cramer >> >> davec@postgresintl.com >> www.postgresintl.com >> >> On 3 August 2017 at 21:44, Fahar Abbas <fahar.abbas@enterprisedb.com> wrote: >>> >>> Hi pgsql-jdbc community! >>> >>> Steps of EDB PostgreSQL9.6 installers download from EnterpriseDB website. >>> >>> ------ >>> 1. Install JDK 7 on Linux 32 and Linux 64 and on mac install JDK 8 >>> 2. Install pgjdbc and postgis from (PostgreSQL) StackBuilder >>> 3. Performs below commands from terminal: >>> >>> For Linux: >>> ------------ >>> export JAVA_HOME=/usr/local/jdk1.7.0_51/bin/java >>> export PATH=/usr/local/jdk1.7.0_51/bin:$PATH >>> export >>> CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>> export >>> CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>> >>> For MAC: >>> ---------- >>> export JAVA_HOME="/Library/Internet\ >>> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" >>> export PATH="/Library/Internet\ >>> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/":$PATH >>> export >>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>> export >>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>> export >>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>> >>> 4. Connect psql with postgres database. >>> >>> 5. <PG_HOME>/bin/psql -d postgres -p 5432 >>> >>> 6. Create Postgis Extensions. >>> >>> CREATE EXTENSION Postgis; >>> CREATE EXTENSION Postgis_topology; >>> CREATE EXTENSION fuzzystrmatch; >>> CREATE EXTENSION Postgis_tiger_geocoder; >>> >>> 7. Verify installed postgis extensions version through psql commands. >>> >>> SELECT postgis_version(); >>> SELECT postgis_full_version(); >>> SELECT postgis_lib_build_date(); >>> SELECT postgis_scripts_installed(); >>> >>> 8. extract postgis-jdbc-2.1.7.2.jar file through jar xf >>> 9. Now execute the example files and execute following query: >>> >>> java examples/TestAutoregister >>> jdbc:postgresql://localhost:5432/postgres postgres postgres >>> >>> Expected Result: >>> ---------------- >>> Postgis jar Example executed successfully. >>> >>> Output: >>> >>> java examples/TestAutoregister >>> jdbc:postgresql://localhost:5432/postgres postgres postgres >>> Testing proper auto-registration >>> Driver version: PostgreSQL 9.4 JDBC4.1 (build 1206) >>> Creating JDBC connection to jdbc:postgresql://localhost:5432/postgres >>> PostGIS Version: 2 >>> PGgeometry successful! >>> Box3d successful! >>> Box2d successful! >>> Finished. >>> TestAutoregister.java finished without errors. >>> >>> Actual Result: >>> -------------- >>> java examples/TestAutoregister >>> jdbc:postgresql://localhost:5432/postgres postgres postgres >>> Testing proper auto-registration >>> Exception in thread "main" java.lang.NoSuchMethodError: >>> org.postgresql.Driver.getVersion()Ljava/lang/String; >>> at examples.TestAutoregister.main(TestAutoregister.java:64) >>> ------------ >>> >>> After complete investigation, I observed that getVersion information >>> has been removed under community 42.jdbc.jar file however in >>> postgis-jdbc-2.1.7.2.jar, we are still using getVersion. >>> >>> We(EDB PostgreSQL team) released last postgis-pg96-2.3.2-1 version on >>> 15-Feb-2017 while community jdbc team removed getVersion from JDBC jar >>> file from PostgreSQL JDBC Driver 42.0.0 version on >>> 19-Feb-2017.(https://jdbc.postgresql.org/) >>> >>> >>> Please note that we are shipping pgjdbc driver from >>> https://jdbc.postgresql.org/download.html while postgis jdbc jar under >>> this location: >>> https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2 >>> >>> Please note that on 9.4.1212 version getVersion information is >>> available but not available on 42.jdbc.jar file >>> >>> Kindly let us know if we are planning to fix that issue or not and we >>> will modify our postgis accordingly? >>> >>> Kind Regards, >>> -- >>> Fahar Abbas >>> QMG >>> EnterpriseDB Corporation >>> >>> >>> -- >>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) >>> To make changes to your subscription: >>> http://www.postgresql.org/mailpref/pgsql-jdbc >> >> > > > > -- > Fahar Abbas > QMG > EnterpriseDB Corporation -- Fahar Abbas QMG EnterpriseDB Corporation Phone Office: +92-51-835-8874 Phone Direct: +92-51-8466803 Mobile: +92-333-5409707 Skype ID: syed.fahar.abbas Website: www.enterprisedb.com
Re: Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Fahar Abbas
Date:
Kindly let us know if this is expected behavior or not or we are planning to fix in next pgjdbc release? On Fri, Aug 4, 2017 at 10:04 AM, Fahar Abbas <fahar.abbas@enterprisedb.com> wrote: > We can not execute TestAutoregister due to missing getVersion under > jdbc.jar file. > > On Fri, Aug 4, 2017 at 10:01 AM, Fahar Abbas > <fahar.abbas@enterprisedb.com> wrote: >> On Fri, Aug 4, 2017 at 9:51 AM, Dave Cramer <pg@fastcrypt.com> wrote: >>> What do you need getVersion() for ? >> https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2 >> >> On the above link if we extract postgis-jdbc-2.1.7.2.jar and this >> contain example TestAutoregister and getVersion is part of it. >> >> >>> >>> Note there are: >>> >>> @Override >>> public int getMajorVersion() { >>> return org.postgresql.util.DriverInfo.MAJOR_VERSION; >>> } >>> >>> @Override >>> public int getMinorVersion() { >>> return org.postgresql.util.DriverInfo.MINOR_VERSION; >>> } >>> >>> >>> >>> Dave Cramer >>> >>> davec@postgresintl.com >>> www.postgresintl.com >>> >>> On 3 August 2017 at 21:44, Fahar Abbas <fahar.abbas@enterprisedb.com> wrote: >>>> >>>> Hi pgsql-jdbc community! >>>> >>>> Steps of EDB PostgreSQL9.6 installers download from EnterpriseDB website. >>>> >>>> ------ >>>> 1. Install JDK 7 on Linux 32 and Linux 64 and on mac install JDK 8 >>>> 2. Install pgjdbc and postgis from (PostgreSQL) StackBuilder >>>> 3. Performs below commands from terminal: >>>> >>>> For Linux: >>>> ------------ >>>> export JAVA_HOME=/usr/local/jdk1.7.0_51/bin/java >>>> export PATH=/usr/local/jdk1.7.0_51/bin:$PATH >>>> export >>>> CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>>> export >>>> CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>>> >>>> For MAC: >>>> ---------- >>>> export JAVA_HOME="/Library/Internet\ >>>> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" >>>> export PATH="/Library/Internet\ >>>> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/":$PATH >>>> export >>>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>>> export >>>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>>> export >>>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>>> >>>> 4. Connect psql with postgres database. >>>> >>>> 5. <PG_HOME>/bin/psql -d postgres -p 5432 >>>> >>>> 6. Create Postgis Extensions. >>>> >>>> CREATE EXTENSION Postgis; >>>> CREATE EXTENSION Postgis_topology; >>>> CREATE EXTENSION fuzzystrmatch; >>>> CREATE EXTENSION Postgis_tiger_geocoder; >>>> >>>> 7. Verify installed postgis extensions version through psql commands. >>>> >>>> SELECT postgis_version(); >>>> SELECT postgis_full_version(); >>>> SELECT postgis_lib_build_date(); >>>> SELECT postgis_scripts_installed(); >>>> >>>> 8. extract postgis-jdbc-2.1.7.2.jar file through jar xf >>>> 9. Now execute the example files and execute following query: >>>> >>>> java examples/TestAutoregister >>>> jdbc:postgresql://localhost:5432/postgres postgres postgres >>>> >>>> Expected Result: >>>> ---------------- >>>> Postgis jar Example executed successfully. >>>> >>>> Output: >>>> >>>> java examples/TestAutoregister >>>> jdbc:postgresql://localhost:5432/postgres postgres postgres >>>> Testing proper auto-registration >>>> Driver version: PostgreSQL 9.4 JDBC4.1 (build 1206) >>>> Creating JDBC connection to jdbc:postgresql://localhost:5432/postgres >>>> PostGIS Version: 2 >>>> PGgeometry successful! >>>> Box3d successful! >>>> Box2d successful! >>>> Finished. >>>> TestAutoregister.java finished without errors. >>>> >>>> Actual Result: >>>> -------------- >>>> java examples/TestAutoregister >>>> jdbc:postgresql://localhost:5432/postgres postgres postgres >>>> Testing proper auto-registration >>>> Exception in thread "main" java.lang.NoSuchMethodError: >>>> org.postgresql.Driver.getVersion()Ljava/lang/String; >>>> at examples.TestAutoregister.main(TestAutoregister.java:64) >>>> ------------ >>>> >>>> After complete investigation, I observed that getVersion information >>>> has been removed under community 42.jdbc.jar file however in >>>> postgis-jdbc-2.1.7.2.jar, we are still using getVersion. >>>> >>>> We(EDB PostgreSQL team) released last postgis-pg96-2.3.2-1 version on >>>> 15-Feb-2017 while community jdbc team removed getVersion from JDBC jar >>>> file from PostgreSQL JDBC Driver 42.0.0 version on >>>> 19-Feb-2017.(https://jdbc.postgresql.org/) >>>> >>>> >>>> Please note that we are shipping pgjdbc driver from >>>> https://jdbc.postgresql.org/download.html while postgis jdbc jar under >>>> this location: >>>> https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2 >>>> >>>> Please note that on 9.4.1212 version getVersion information is >>>> available but not available on 42.jdbc.jar file >>>> >>>> Kindly let us know if we are planning to fix that issue or not and we >>>> will modify our postgis accordingly? >>>> >>>> Kind Regards, >>>> -- >>>> Fahar Abbas >>>> QMG >>>> EnterpriseDB Corporation >>>> >>>> >>>> -- >>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) >>>> To make changes to your subscription: >>>> http://www.postgresql.org/mailpref/pgsql-jdbc >>> >>> >> >> >> >> -- >> Fahar Abbas >> QMG >> EnterpriseDB Corporation > > > > -- > Fahar Abbas > QMG > EnterpriseDB Corporation -- Fahar Abbas QMG EnterpriseDB Corporation
Re: [JDBC] Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Fahar Abbas
Date:
Kindly let us know if this is expected behavior or not or we are planning to fix in next pgjdbc release? On Fri, Aug 4, 2017 at 10:04 AM, Fahar Abbas <fahar.abbas@enterprisedb.com> wrote: > We can not execute TestAutoregister due to missing getVersion under > jdbc.jar file. > > On Fri, Aug 4, 2017 at 10:01 AM, Fahar Abbas > <fahar.abbas@enterprisedb.com> wrote: >> On Fri, Aug 4, 2017 at 9:51 AM, Dave Cramer <pg@fastcrypt.com> wrote: >>> What do you need getVersion() for ? >> https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2 >> >> On the above link if we extract postgis-jdbc-2.1.7.2.jar and this >> contain example TestAutoregister and getVersion is part of it. >> >> >>> >>> Note there are: >>> >>> @Override >>> public int getMajorVersion() { >>> return org.postgresql.util.DriverInfo.MAJOR_VERSION; >>> } >>> >>> @Override >>> public int getMinorVersion() { >>> return org.postgresql.util.DriverInfo.MINOR_VERSION; >>> } >>> >>> >>> >>> Dave Cramer >>> >>> davec@postgresintl.com >>> www.postgresintl.com >>> >>> On 3 August 2017 at 21:44, Fahar Abbas <fahar.abbas@enterprisedb.com> wrote: >>>> >>>> Hi pgsql-jdbc community! >>>> >>>> Steps of EDB PostgreSQL9.6 installers download from EnterpriseDB website. >>>> >>>> ------ >>>> 1. Install JDK 7 on Linux 32 and Linux 64 and on mac install JDK 8 >>>> 2. Install pgjdbc and postgis from (PostgreSQL) StackBuilder >>>> 3. Performs below commands from terminal: >>>> >>>> For Linux: >>>> ------------ >>>> export JAVA_HOME=/usr/local/jdk1.7.0_51/bin/java >>>> export PATH=/usr/local/jdk1.7.0_51/bin:$PATH >>>> export >>>> CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>>> export >>>> CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>>> >>>> For MAC: >>>> ---------- >>>> export JAVA_HOME="/Library/Internet\ >>>> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" >>>> export PATH="/Library/Internet\ >>>> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/":$PATH >>>> export >>>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>>> export >>>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>>> export >>>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH >>>> >>>> 4. Connect psql with postgres database. >>>> >>>> 5. <PG_HOME>/bin/psql -d postgres -p 5432 >>>> >>>> 6. Create Postgis Extensions. >>>> >>>> CREATE EXTENSION Postgis; >>>> CREATE EXTENSION Postgis_topology; >>>> CREATE EXTENSION fuzzystrmatch; >>>> CREATE EXTENSION Postgis_tiger_geocoder; >>>> >>>> 7. Verify installed postgis extensions version through psql commands. >>>> >>>> SELECT postgis_version(); >>>> SELECT postgis_full_version(); >>>> SELECT postgis_lib_build_date(); >>>> SELECT postgis_scripts_installed(); >>>> >>>> 8. extract postgis-jdbc-2.1.7.2.jar file through jar xf >>>> 9. Now execute the example files and execute following query: >>>> >>>> java examples/TestAutoregister >>>> jdbc:postgresql://localhost:5432/postgres postgres postgres >>>> >>>> Expected Result: >>>> ---------------- >>>> Postgis jar Example executed successfully. >>>> >>>> Output: >>>> >>>> java examples/TestAutoregister >>>> jdbc:postgresql://localhost:5432/postgres postgres postgres >>>> Testing proper auto-registration >>>> Driver version: PostgreSQL 9.4 JDBC4.1 (build 1206) >>>> Creating JDBC connection to jdbc:postgresql://localhost:5432/postgres >>>> PostGIS Version: 2 >>>> PGgeometry successful! >>>> Box3d successful! >>>> Box2d successful! >>>> Finished. >>>> TestAutoregister.java finished without errors. >>>> >>>> Actual Result: >>>> -------------- >>>> java examples/TestAutoregister >>>> jdbc:postgresql://localhost:5432/postgres postgres postgres >>>> Testing proper auto-registration >>>> Exception in thread "main" java.lang.NoSuchMethodError: >>>> org.postgresql.Driver.getVersion()Ljava/lang/String; >>>> at examples.TestAutoregister.main(TestAutoregister.java:64) >>>> ------------ >>>> >>>> After complete investigation, I observed that getVersion information >>>> has been removed under community 42.jdbc.jar file however in >>>> postgis-jdbc-2.1.7.2.jar, we are still using getVersion. >>>> >>>> We(EDB PostgreSQL team) released last postgis-pg96-2.3.2-1 version on >>>> 15-Feb-2017 while community jdbc team removed getVersion from JDBC jar >>>> file from PostgreSQL JDBC Driver 42.0.0 version on >>>> 19-Feb-2017.(https://jdbc.postgresql.org/) >>>> >>>> >>>> Please note that we are shipping pgjdbc driver from >>>> https://jdbc.postgresql.org/download.html while postgis jdbc jar under >>>> this location: >>>> https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2 >>>> >>>> Please note that on 9.4.1212 version getVersion information is >>>> available but not available on 42.jdbc.jar file >>>> >>>> Kindly let us know if we are planning to fix that issue or not and we >>>> will modify our postgis accordingly? >>>> >>>> Kind Regards, >>>> -- >>>> Fahar Abbas >>>> QMG >>>> EnterpriseDB Corporation >>>> >>>> >>>> -- >>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) >>>> To make changes to your subscription: >>>> http://www.postgresql.org/mailpref/pgsql-jdbc >>> >>> >> >> >> >> -- >> Fahar Abbas >> QMG >> EnterpriseDB Corporation > > > > -- > Fahar Abbas > QMG > EnterpriseDB Corporation -- Fahar Abbas QMG EnterpriseDB Corporation
Re: Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Vladimir Sitnikov
Date:
I'm inclined to revert org.postgresql.Driver.getVersion and file a PR to PostGIS to avoid use of the method.
Vladimir
пт, 4 авг. 2017 г. в 9:18, Fahar Abbas <fahar.abbas@enterprisedb.com>:
Kindly let us know if this is expected behavior or not or we are
planning to fix in next pgjdbc release?
On Fri, Aug 4, 2017 at 10:04 AM, Fahar Abbas
<fahar.abbas@enterprisedb.com> wrote:
> We can not execute TestAutoregister due to missing getVersion under
> jdbc.jar file.
>
> On Fri, Aug 4, 2017 at 10:01 AM, Fahar Abbas
> <fahar.abbas@enterprisedb.com> wrote:
>> On Fri, Aug 4, 2017 at 9:51 AM, Dave Cramer <pg@fastcrypt.com> wrote:
>>> What do you need getVersion() for ?
>> https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2
>>
>> On the above link if we extract postgis-jdbc-2.1.7.2.jar and this
>> contain example TestAutoregister and getVersion is part of it.
>>
>>
>>>
>>> Note there are:
>>>
>>> @Override
>>> public int getMajorVersion() {
>>> return org.postgresql.util.DriverInfo.MAJOR_VERSION;
>>> }
>>>
>>> @Override
>>> public int getMinorVersion() {
>>> return org.postgresql.util.DriverInfo.MINOR_VERSION;
>>> }
>>>
>>>
>>>
>>> Dave Cramer
>>>
>>> davec@postgresintl.com
>>> www.postgresintl.com
>>>
>>> On 3 August 2017 at 21:44, Fahar Abbas <fahar.abbas@enterprisedb.com> wrote:
>>>>
>>>> Hi pgsql-jdbc community!
>>>>
>>>> Steps of EDB PostgreSQL9.6 installers download from EnterpriseDB website.
>>>>
>>>> ------
>>>> 1. Install JDK 7 on Linux 32 and Linux 64 and on mac install JDK 8
>>>> 2. Install pgjdbc and postgis from (PostgreSQL) StackBuilder
>>>> 3. Performs below commands from terminal:
>>>>
>>>> For Linux:
>>>> ------------
>>>> export JAVA_HOME=/usr/local/jdk1.7.0_51/bin/java
>>>> export PATH=/usr/local/jdk1.7.0_51/bin:$PATH
>>>> export
>>>> CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH
>>>> export
>>>> CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH
>>>>
>>>> For MAC:
>>>> ----------
>>>> export JAVA_HOME="/Library/Internet\
>>>> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java"
>>>> export PATH="/Library/Internet\
>>>> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/":$PATH
>>>> export
>>>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH
>>>> export
>>>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH
>>>> export
>>>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH
>>>>
>>>> 4. Connect psql with postgres database.
>>>>
>>>> 5. <PG_HOME>/bin/psql -d postgres -p 5432
>>>>
>>>> 6. Create Postgis Extensions.
>>>>
>>>> CREATE EXTENSION Postgis;
>>>> CREATE EXTENSION Postgis_topology;
>>>> CREATE EXTENSION fuzzystrmatch;
>>>> CREATE EXTENSION Postgis_tiger_geocoder;
>>>>
>>>> 7. Verify installed postgis extensions version through psql commands.
>>>>
>>>> SELECT postgis_version();
>>>> SELECT postgis_full_version();
>>>> SELECT postgis_lib_build_date();
>>>> SELECT postgis_scripts_installed();
>>>>
>>>> 8. extract postgis-jdbc-2.1.7.2.jar file through jar xf
>>>> 9. Now execute the example files and execute following query:
>>>>
>>>> java examples/TestAutoregister
>>>> jdbc:postgresql://localhost:5432/postgres postgres postgres
>>>>
>>>> Expected Result:
>>>> ----------------
>>>> Postgis jar Example executed successfully.
>>>>
>>>> Output:
>>>>
>>>> java examples/TestAutoregister
>>>> jdbc:postgresql://localhost:5432/postgres postgres postgres
>>>> Testing proper auto-registration
>>>> Driver version: PostgreSQL 9.4 JDBC4.1 (build 1206)
>>>> Creating JDBC connection to jdbc:postgresql://localhost:5432/postgres
>>>> PostGIS Version: 2
>>>> PGgeometry successful!
>>>> Box3d successful!
>>>> Box2d successful!
>>>> Finished.
>>>> TestAutoregister.java finished without errors.
>>>>
>>>> Actual Result:
>>>> --------------
>>>> java examples/TestAutoregister
>>>> jdbc:postgresql://localhost:5432/postgres postgres postgres
>>>> Testing proper auto-registration
>>>> Exception in thread "main" java.lang.NoSuchMethodError:
>>>> org.postgresql.Driver.getVersion()Ljava/lang/String;
>>>> at examples.TestAutoregister.main(TestAutoregister.java:64)
>>>> ------------
>>>>
>>>> After complete investigation, I observed that getVersion information
>>>> has been removed under community 42.jdbc.jar file however in
>>>> postgis-jdbc-2.1.7.2.jar, we are still using getVersion.
>>>>
>>>> We(EDB PostgreSQL team) released last postgis-pg96-2.3.2-1 version on
>>>> 15-Feb-2017 while community jdbc team removed getVersion from JDBC jar
>>>> file from PostgreSQL JDBC Driver 42.0.0 version on
>>>> 19-Feb-2017.(https://jdbc.postgresql.org/)
>>>>
>>>>
>>>> Please note that we are shipping pgjdbc driver from
>>>> https://jdbc.postgresql.org/download.html while postgis jdbc jar under
>>>> this location:
>>>> https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2
>>>>
>>>> Please note that on 9.4.1212 version getVersion information is
>>>> available but not available on 42.jdbc.jar file
>>>>
>>>> Kindly let us know if we are planning to fix that issue or not and we
>>>> will modify our postgis accordingly?
>>>>
>>>> Kind Regards,
>>>> --
>>>> Fahar Abbas
>>>> QMG
>>>> EnterpriseDB Corporation
>>>>
>>>>
>>>> --
>>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>>>> To make changes to your subscription:
>>>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>>
>>>
>>
>>
>>
>> --
>> Fahar Abbas
>> QMG
>> EnterpriseDB Corporation
>
>
>
> --
> Fahar Abbas
> QMG
> EnterpriseDB Corporation
--
Fahar Abbas
QMG
EnterpriseDB Corporation
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
Re: [JDBC] Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Vladimir Sitnikov
Date:
I'm inclined to revert org.postgresql.Driver.getVersion and file a PR to PostGIS to avoid use of the method.
Vladimir
пт, 4 авг. 2017 г. в 9:18, Fahar Abbas <fahar.abbas@enterprisedb.com>:
Kindly let us know if this is expected behavior or not or we are
planning to fix in next pgjdbc release?
On Fri, Aug 4, 2017 at 10:04 AM, Fahar Abbas
<fahar.abbas@enterprisedb.com> wrote:
> We can not execute TestAutoregister due to missing getVersion under
> jdbc.jar file.
>
> On Fri, Aug 4, 2017 at 10:01 AM, Fahar Abbas
> <fahar.abbas@enterprisedb.com> wrote:
>> On Fri, Aug 4, 2017 at 9:51 AM, Dave Cramer <pg@fastcrypt.com> wrote:
>>> What do you need getVersion() for ?
>> https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2
>>
>> On the above link if we extract postgis-jdbc-2.1.7.2.jar and this
>> contain example TestAutoregister and getVersion is part of it.
>>
>>
>>>
>>> Note there are:
>>>
>>> @Override
>>> public int getMajorVersion() {
>>> return org.postgresql.util.DriverInfo.MAJOR_VERSION;
>>> }
>>>
>>> @Override
>>> public int getMinorVersion() {
>>> return org.postgresql.util.DriverInfo.MINOR_VERSION;
>>> }
>>>
>>>
>>>
>>> Dave Cramer
>>>
>>> davec@postgresintl.com
>>> www.postgresintl.com
>>>
>>> On 3 August 2017 at 21:44, Fahar Abbas <fahar.abbas@enterprisedb.com> wrote:
>>>>
>>>> Hi pgsql-jdbc community!
>>>>
>>>> Steps of EDB PostgreSQL9.6 installers download from EnterpriseDB website.
>>>>
>>>> ------
>>>> 1. Install JDK 7 on Linux 32 and Linux 64 and on mac install JDK 8
>>>> 2. Install pgjdbc and postgis from (PostgreSQL) StackBuilder
>>>> 3. Performs below commands from terminal:
>>>>
>>>> For Linux:
>>>> ------------
>>>> export JAVA_HOME=/usr/local/jdk1.7.0_51/bin/java
>>>> export PATH=/usr/local/jdk1.7.0_51/bin:$PATH
>>>> export
>>>> CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH
>>>> export
>>>> CLASSPATH=.:/opt/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/opt/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH
>>>>
>>>> For MAC:
>>>> ----------
>>>> export JAVA_HOME="/Library/Internet\
>>>> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java"
>>>> export PATH="/Library/Internet\
>>>> Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/":$PATH
>>>> export
>>>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH
>>>> export
>>>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre6.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH
>>>> export
>>>> CLASSPATH=.:/Library/PostgreSQL/pgJDBC/postgresql-42.1.3.jre7.jar:/Library/PostgreSQL/9.6/PostGIS/java/jdbc/postgis-jdbc-2.1.7.2.jar:$CLASSPATH
>>>>
>>>> 4. Connect psql with postgres database.
>>>>
>>>> 5. <PG_HOME>/bin/psql -d postgres -p 5432
>>>>
>>>> 6. Create Postgis Extensions.
>>>>
>>>> CREATE EXTENSION Postgis;
>>>> CREATE EXTENSION Postgis_topology;
>>>> CREATE EXTENSION fuzzystrmatch;
>>>> CREATE EXTENSION Postgis_tiger_geocoder;
>>>>
>>>> 7. Verify installed postgis extensions version through psql commands.
>>>>
>>>> SELECT postgis_version();
>>>> SELECT postgis_full_version();
>>>> SELECT postgis_lib_build_date();
>>>> SELECT postgis_scripts_installed();
>>>>
>>>> 8. extract postgis-jdbc-2.1.7.2.jar file through jar xf
>>>> 9. Now execute the example files and execute following query:
>>>>
>>>> java examples/TestAutoregister
>>>> jdbc:postgresql://localhost:5432/postgres postgres postgres
>>>>
>>>> Expected Result:
>>>> ----------------
>>>> Postgis jar Example executed successfully.
>>>>
>>>> Output:
>>>>
>>>> java examples/TestAutoregister
>>>> jdbc:postgresql://localhost:5432/postgres postgres postgres
>>>> Testing proper auto-registration
>>>> Driver version: PostgreSQL 9.4 JDBC4.1 (build 1206)
>>>> Creating JDBC connection to jdbc:postgresql://localhost:5432/postgres
>>>> PostGIS Version: 2
>>>> PGgeometry successful!
>>>> Box3d successful!
>>>> Box2d successful!
>>>> Finished.
>>>> TestAutoregister.java finished without errors.
>>>>
>>>> Actual Result:
>>>> --------------
>>>> java examples/TestAutoregister
>>>> jdbc:postgresql://localhost:5432/postgres postgres postgres
>>>> Testing proper auto-registration
>>>> Exception in thread "main" java.lang.NoSuchMethodError:
>>>> org.postgresql.Driver.getVersion()Ljava/lang/String;
>>>> at examples.TestAutoregister.main(TestAutoregister.java:64)
>>>> ------------
>>>>
>>>> After complete investigation, I observed that getVersion information
>>>> has been removed under community 42.jdbc.jar file however in
>>>> postgis-jdbc-2.1.7.2.jar, we are still using getVersion.
>>>>
>>>> We(EDB PostgreSQL team) released last postgis-pg96-2.3.2-1 version on
>>>> 15-Feb-2017 while community jdbc team removed getVersion from JDBC jar
>>>> file from PostgreSQL JDBC Driver 42.0.0 version on
>>>> 19-Feb-2017.(https://jdbc.postgresql.org/)
>>>>
>>>>
>>>> Please note that we are shipping pgjdbc driver from
>>>> https://jdbc.postgresql.org/download.html while postgis jdbc jar under
>>>> this location:
>>>> https://mvnrepository.com/artifact/net.postgis/postgis-jdbc/2.1.7.2
>>>>
>>>> Please note that on 9.4.1212 version getVersion information is
>>>> available but not available on 42.jdbc.jar file
>>>>
>>>> Kindly let us know if we are planning to fix that issue or not and we
>>>> will modify our postgis accordingly?
>>>>
>>>> Kind Regards,
>>>> --
>>>> Fahar Abbas
>>>> QMG
>>>> EnterpriseDB Corporation
>>>>
>>>>
>>>> --
>>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>>>> To make changes to your subscription:
>>>> http://www.postgresql.org/mailpref/pgsql-jdbc
>>>
>>>
>>
>>
>>
>> --
>> Fahar Abbas
>> QMG
>> EnterpriseDB Corporation
>
>
>
> --
> Fahar Abbas
> QMG
> EnterpriseDB Corporation
--
Fahar Abbas
QMG
EnterpriseDB Corporation
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
Re: [JDBC] Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Vladimir Sitnikov
Date:
>Kindly let us know if this is expected behavior or not or we are
planning to fix in next pgjdbc release?I've reintroduced Driver.getVersion, and it will come as a part of pgjdbc 42.1.5 in a couple of weeks or so.
Re: Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Vladimir Sitnikov
Date:
>Kindly let us know if this is expected behavior or not or we are
planning to fix in next pgjdbc release?I've reintroduced Driver.getVersion, and it will come as a part of pgjdbc 42.1.5 in a couple of weeks or so.
Re: Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Dave Cramer
Date:
Fahar,
Given that the use of this private method is simply to print out the version of the driver in an example.
I think it would be appropriate if the code in the example was changed as soon as possible.
It has been re-added as deprecated so you can expect it to be removed again in the future.
Thanks
On 4 August 2017 at 06:45, Vladimir Sitnikov <sitnikov.vladimir@gmail.com> wrote:
>Kindly let us know if this is expected behavior or not or we areplanning to fix in next pgjdbc release?I've reintroduced Driver.getVersion, and it will come as a part of pgjdbc 42.1.5 in a couple of weeks or so.Vladimir
Re: [JDBC] Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Dave Cramer
Date:
Fahar,
Given that the use of this private method is simply to print out the version of the driver in an example.
I think it would be appropriate if the code in the example was changed as soon as possible.
It has been re-added as deprecated so you can expect it to be removed again in the future.
Thanks
On 4 August 2017 at 06:45, Vladimir Sitnikov <sitnikov.vladimir@gmail.com> wrote:
>Kindly let us know if this is expected behavior or not or we areplanning to fix in next pgjdbc release?I've reintroduced Driver.getVersion, and it will come as a part of pgjdbc 42.1.5 in a couple of weeks or so.Vladimir
Re: [JDBC] Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Vladimir Sitnikov
Date:
Well,
There's org.postgis.DriverWrapper.getVersion() {
return "PostGisWrapper " + REVISION + ", wrapping " + Driver.getVersion();
There are 9 other usages ( https://github.com/postgis/postgis-java/search?utf8=%E2%9C%93&q=%22Driver.getVersion%22&type= )
Vladimir
Re: Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Vladimir Sitnikov
Date:
Well,
There's org.postgis.DriverWrapper.getVersion() {
return "PostGisWrapper " + REVISION + ", wrapping " + Driver.getVersion();
There are 9 other usages ( https://github.com/postgis/postgis-java/search?utf8=%E2%9C%93&q=%22Driver.getVersion%22&type= )
Vladimir
Re: Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Dave Cramer
Date:
Fair enough.
We can leave it in there, it's not like it is a big deal. However we may want to remove the deprecated annotation?
On 4 August 2017 at 10:21, Vladimir Sitnikov <sitnikov.vladimir@gmail.com> wrote:
Well,There's org.postgis.DriverWrapper.getVersion() { return "PostGisWrapper " + REVISION + ", wrapping " + Driver.getVersion();There are 9 other usages ( https://github.com/postgis/postgis-java/search?utf8=%E2% 9C%93&q=%22Driver.getVersion% 22&type= ) Vladimir
Re: [JDBC] Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Dave Cramer
Date:
Fair enough.
We can leave it in there, it's not like it is a big deal. However we may want to remove the deprecated annotation?
On 4 August 2017 at 10:21, Vladimir Sitnikov <sitnikov.vladimir@gmail.com> wrote:
Well,There's org.postgis.DriverWrapper.getVersion() { return "PostGisWrapper " + REVISION + ", wrapping " + Driver.getVersion();There are 9 other usages ( https://github.com/postgis/postgis-java/search?utf8=%E2% 9C%93&q=%22Driver.getVersion% 22&type= ) Vladimir
Re: [JDBC] Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Vladimir Sitnikov
Date:
>We can leave it in there, it's not like it is a big deal. However we may want to remove the deprecated annotation?
You are reading my mind.
Vladimir
Re: Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Vladimir Sitnikov
Date:
>We can leave it in there, it's not like it is a big deal. However we may want to remove the deprecated annotation?
You are reading my mind.
Vladimir
Re: [JDBC] Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Dave Cramer
Date:
On 4 August 2017 at 10:33, Vladimir Sitnikov <sitnikov.vladimir@gmail.com> wrote:
>We can leave it in there, it's not like it is a big deal. However we may want to remove the deprecated annotation?You are reading my mind.
However ... If we are going to make methods public then we are sort of publishing a contract and we can't just go about removing them.
Re: Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Dave Cramer
Date:
On 4 August 2017 at 10:33, Vladimir Sitnikov <sitnikov.vladimir@gmail.com> wrote:
>We can leave it in there, it's not like it is a big deal. However we may want to remove the deprecated annotation?You are reading my mind.
However ... If we are going to make methods public then we are sort of publishing a contract and we can't just go about removing them.
Re: [JDBC] Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Vladimir Sitnikov
Date:
>If we are going to make methods public then we are sort of publishing a contract and we can't just go about removing them.
So we should invent the contract.
The "problem" with current Driver#getMajorVersion/getMinorVersion is the methods return just int, and they do not have a room for a full version (e.g. JRE variation).
Vladimir
Re: Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Vladimir Sitnikov
Date:
>If we are going to make methods public then we are sort of publishing a contract and we can't just go about removing them.
So we should invent the contract.
The "problem" with current Driver#getMajorVersion/getMinorVersion is the methods return just int, and they do not have a room for a full version (e.g. JRE variation).
Vladimir
Re: [JDBC] Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Jorge Solórzano
Date:
Please don't remove the deprecated annotation, postgis-jdbc should have not used that method in first place, and it's just a convenience method that should not be public.
It's ok to have that method forever, but the deprecated annotation is a clear sign that it should not be used, for future use.
I get the problem with current getMajor/MinorVersion, but isn't more appropriate to redirect anyone directly to org.postgresql.util.DriverInfo for those that want "special" formating? (here with a big asterisk that this class should not be for "public use").
Jorge Solórzano
On Fri, Aug 4, 2017 at 11:42 AM, Vladimir Sitnikov <sitnikov.vladimir@gmail.com> wrote:
>If we are going to make methods public then we are sort of publishing a contract and we can't just go about removing them.So we should invent the contract.The "problem" with current Driver#getMajorVersion/getMinorVersion is the methods return just int, and they do not have a room for a full version (e.g. JRE variation). Vladimir
Re: Postgis example TestAutoregister is not working due tomissing getVersion() from pgjdbc community jar
From
Jorge Solórzano
Date:
Please don't remove the deprecated annotation, postgis-jdbc should have not used that method in first place, and it's just a convenience method that should not be public.
It's ok to have that method forever, but the deprecated annotation is a clear sign that it should not be used, for future use.
I get the problem with current getMajor/MinorVersion, but isn't more appropriate to redirect anyone directly to org.postgresql.util.DriverInfo for those that want "special" formating? (here with a big asterisk that this class should not be for "public use").
Jorge Solórzano
On Fri, Aug 4, 2017 at 11:42 AM, Vladimir Sitnikov <sitnikov.vladimir@gmail.com> wrote:
>If we are going to make methods public then we are sort of publishing a contract and we can't just go about removing them.So we should invent the contract.The "problem" with current Driver#getMajorVersion/getMinorVersion is the methods return just int, and they do not have a room for a full version (e.g. JRE variation). Vladimir