problem with the postgisdriver-1.2.0 and JUMP1.2-Alpha1

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

problem with the postgisdriver-1.2.0 and JUMP1.2-Alpha1

Uwe Dalluege
Hi

I have a problem with the postgisdriver-1.2.0
together with JUMP1.2-Alpha1

Problem:

When I do the following in JUMP ... (A)

1. Load Dataset(s)...    (from PostGIS)
2. Save Task As ...
3. Open Task ...

everything is all right :-)

But when I do the following in JUMP ... (B)

1. Load Dataset(s)...    (from PostGIS)
2. Save Dataset As ...   (back to the DataBase PostgreSQL)
3. Save Task As ...
4. Open Task ...

then I receive the error:

ERROR: syntax error at or near "null"

java.lang.IllegalStateException: ERROR: syntax error at or near "null"
 at
net.refractions.postgis.PostGISConnection.executeQuery(PostGISConnection.jav
a:179)
 at
net.refractions.postgis.PostGISConnection.executeQuery(PostGISConnection.jav
a:570)
 at
com.vividsolutions.jump.workbench.ui.plugin.OpenProjectPlugIn.executeQuery(O
penProjectPlugIn.java:191)
 at
com.vividsolutions.jump.workbench.ui.plugin.OpenProjectPlugIn.load(OpenProje
ctPlugIn.java:178)
 at
com.vividsolutions.jump.workbench.ui.plugin.OpenProjectPlugIn.loadLayers(Ope
nProjectPlugIn.java:162)
 at
com.vividsolutions.jump.workbench.ui.plugin.OpenProjectPlugIn.run(OpenProjec
tPlugIn.java:99)
 at
com.vividsolutions.jump.workbench.ui.task.TaskMonitorManager$TaskWrapper.run
(TaskMonitorManager.java:148)
 at java.lang.Thread.run(Unknown Source)


The different between (A) and (B) is, that I save the Dataset and then I
save the Task.

When I take a look at the two Task-Files (.jmp) I see, that they
differ in the <query> row.

.. This works case (A) (Open Task):

 <data-source-query>
   <query>SELECT * FROM punkte</query>
    <data-source
class="net.refractions.postgis.PostGISDataSource">

.. This do not work case (B) (because query null="true")!

  <data-source-query>
   <query null="true" />
   <data-source
class="net.refractions.postgis.PostGISDataSource">

Solution (maybe):

The class PostGISSaveDataSourceQueryChooser
has a method getDataSourceQueries()

This do not work (the null in 8) is maybe wrong?):
...
1)  public Collection getDataSourceQueries() {
2)    StringBuffer sql = new StringBuffer();
3)    Map properties = super.getProperties();
4)
5)    //we dont need to specify the update query since the connection
6)    // will do that for us. We only need to specify the table
7)    PostGISDataSourceQuery query = new PostGISDataSourceQuery(
8)      getDataSource(), null,
(String)properties.get(PostGISDataSource.TABLE_KEY)
9)    );
10)    query.setProperties(getProperties());
11)
12)    List queries = new ArrayList();
13)    queries.add(query);
14)
15)    return(queries);
16)  }
...

This works (I changed null to updateQuery):
...

  public Collection getDataSourceQueries() {
    StringBuffer sql = new StringBuffer();
    Map properties = super.getProperties();

    //we dont need to specify the update query since the connection
    // will do that for us. We only need to specify the table

    String updateQuery =
      "SELECT * FROM " +
      (String)properties.get(PostGISDataSource.TABLE_KEY);

    PostGISDataSourceQuery query = new PostGISDataSourceQuery(
      getDataSource(), updateQuery,
(String)properties.get(PostGISDataSource.TABLE_KEY)
    );
    query.setProperties(getProperties());

    List queries = new ArrayList();
    queries.add(query);

    return(queries);
  }
...

I am a little confused, because the comment says:

    //we dont need to specify the update query since the connection
    // will do that for us. We only need to specify the table

Is there another solution?

Thank you for your help.

Uwe Dalluege
--------------------------------------------------------------------------
Hochschule fuer Angewandte Wissenschaften Hamburg
- University of Applied Sciences -
Fachbereich Geomatik
Rechenzentrum
Dipl.-Ing. Uwe Dalluege   :-)
Hebebrandstr. 1
22297 Hamburg
Tel.: +49 40 42875 - 5335 oder 5353 oder 5313
Fax:  +49 40 42875 - 5409
E-Mail: mailto:[hidden email]
Url: http://www.haw-hamburg.de/geomatik/
--------------------------------------------------------------------------

_______________________________________________
postgis-users mailing list
[hidden email]
http://postgis.refractions.net/mailman/listinfo/postgis-users
Loading...