5
votes

I would like to query the PostGIS/PostgreSQL database from Java.

PostgreSQL 9.4 is installed.

PostGIS 2.1 Bundle for PostgreSQL 9.4 is installed through Stack Builder.

The PostGIS manual says: "Java clients can access PostGIS "geometry" objects in the PostgreSQL database either directly as text representations or using the JDBC extension objects bundled with PostGIS. In order to use the extension objects, the "postgis.jar" file must be in your CLASSPATH along with the "postgresql.jar" JDBC driver package."

Where do I find the postgis.jar file?

4
have you install post gis along with postgreySQL??Pratik

4 Answers

0
votes

I would prefer to get the sources from a maven repository and include it in my POM.

0
votes

You can use these dependencies instead:

<dependency>
    <groupId>net.postgis</groupId>
    <artifactId>postgis-jdbc</artifactId>
    <version>${driver.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.postgis/postgis-geometry -->
<dependency>
    <groupId>net.postgis</groupId>
    <artifactId>postgis-geometry</artifactId>
    <version>${driver.version}</version>
</dependency>