Yes, this solves the problem.
I've now also, succeeded in doing it throught jdbc/sql statements, thats
makes the whole thing more efficient when only a few changes are made
into the database. It would be nice to add a kind of "void
SetSaveMasterDbf(boolean b)" member to EsriShapeExport that let the user
decide himsel if he wants or not save the .dbf file.
In a next OpenMap release perhaps?
b.
Lonnie D. Goad wrote:
>Check this out from the openmap archives:
>
>http://openmap.bbn.com/mailArchives/openmap-users/2002-07/0972.html
>
>Hope it helps.
>
>-----Original Message-----
>From: owner-openmap-users@bbn.com [mailto:owner-openmap-users@bbn.com]
>On Behalf Of Bart Jourquin
>Sent: Thursday, October 10, 2002 6:02 AM
>To: openmap-users
>Subject: How to save shp & dbf from an EsriPlugin?
>
>
>Hi all,
>
>I derived my own class from EsriPlugin, which allows to add, delete or
>modify shapes and their associated dbf records.
>
>Now, what is the best way to commit my changes to the relevant files?
>
>Attempt 1 :
>---------------
>I modified the EsriShapeExport file in order to only save .shp and .shx
>files. The changes in the .dbf file are then commited through sql
>statements (jdbc). This works OK as long as no new shapes are added, in
>which case EsriPlugin causes an exception when the mouse moves over a
>shape (popup):
>
>java.lang.NumberFormatException: empty String
>java.lang.IllegalArgumentException: Cannot set a null TableModel
> at javax.swing.JTable.setModel(JTable.java:2695)
>
>Attempt2 :
>--------------
>I would like to use a solution that is close to the first attemps for
>performance reasons (just commit what is needed in the .dbf, instead of
>streaming the whole stuff), but I tried the original EsriShapeExport.
>
>My code :
>if (_dirtyShp) {
> getEsriGraphicList().setTable(getModel());
> EsriShapeExport esriShapeExport = new
>EsriShapeExport(getEsriGraphicList(), proj, _tablePath+"/"+_tableName);
> esriShapeExport.export();
> _dirtyShp = false;
> }
>Doing this, the associated .dbf file has the correct table model, but
>all the records are set to the content of the first one....
>
>So, what did I miss?
>
>Many thanks
>
>
>b.
>
>
>
-- Prof Dr Bart Jourquin F.U.Ca.M. - G.T.M. Chaussée de Binche, 151a B7000 Belgium Tel. : +32 65 323293 Fax. : +32 65 315691 http://message.fucam.ac.be/~jourquin -- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Sat Oct 12 06:13:16 2002
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:33 EDT