gistoolkit.datasources.db2spatialextender
Class UpdateableSpatialExtenderDataSource

java.lang.Object
  extended bygistoolkit.datasources.SimpleDataSource
      extended bygistoolkit.datasources.SimpleDBDataSource
          extended bygistoolkit.datasources.db2spatialextender.SpatialExtenderDataSource
              extended bygistoolkit.datasources.db2spatialextender.UpdateableSpatialExtenderDataSource
All Implemented Interfaces:
DataSource

public class UpdateableSpatialExtenderDataSource
extends SpatialExtenderDataSource

Allowing joins in a map is very powerfull, but it gets into some very harry issues when it comes to updating, deleting, and otherwise modifying the base data. To facilitate a more direct and intuative approach to the problem, this datasource was created.


Field Summary
(package private)  int tempMaxInt
           
 
Fields inherited from class gistoolkit.datasources.db2spatialextender.SpatialExtenderDataSource
MAX_DB2_INT, myDatabaseName, myEnvelope
 
Fields inherited from class gistoolkit.datasources.SimpleDataSource
 
Constructor Summary
UpdateableSpatialExtenderDataSource()
          Creates new UpdatableSpatialExtenderDataSource
 
Method Summary
 java.sql.Connection connect()
          Connects this datasource to the database, calls the connect in the super class.
 void doCommit()
          Commit all changes since the last commit.
 void doDelete(Record inRecord)
          Delete this record from the database.
 void doInsert(Record inRecord)
          Inserts the given record into the datasource.
 void doRollback()
          Rollback any changes to this datasource since the last commit.
 void doUpdate(Record inRecord)
          Update the data source with the changed record.
 java.lang.String getDatabaseTableName()
          Return the table name from which to retrieve data from spatial extender
 Node getNode()
          Get the configuration information for this data source
 Style getStyle()
          Get the style to use with this datasource.
 boolean isUpdateable()
          Returns true.
 GISDataset readShapes(Envelope inEnvelope)
          Reads the objects from the database that fall within the given Envelope.
 void releaseUpdateConnection()
          Return the update connection.
 java.sql.Connection requestUpdateConnection()
          Get a connection that can be used for updates.
 void setDatabaseTableName(java.lang.String inDatabaseTableName)
          set the table name from which to retrieve data from spatial extender
 void setNode(Node inNode)
          Set the configuration information for this data source
 
Methods inherited from class gistoolkit.datasources.db2spatialextender.SpatialExtenderDataSource
checkMaxPoint, getDatabaseDriver, getDatabaseName, getDatabasePassword, getDatabasePort, getDatabaseSchema, getDatabaseServername, getDatabaseShapeColumn, getDatabaseSpatialReferenceID, getDatabaseURLBase, getDatabaseUsername, getJDBCURL, getName, getSQLConverter, getWhereString, readEnvelope, setDatabaseDriver, setDatabaseName, setDatabasePassword, setDatabasePort, setDatabaseSchema, setDatabaseServername, setDatabaseShapeColumn, setDatabaseSpatialReferenceID, setDatabaseSpatialReferenceID, setDatabaseURLBase, setDatabaseUsername, setName
 
Methods inherited from class gistoolkit.datasources.SimpleDBDataSource
getFilter, getFilterSQL, setFilter
 
Methods inherited from class gistoolkit.datasources.SimpleDataSource
addDataSourceListener, clearCache, commit, delete, filterDataset, fireCommit, fireDelete, fireInsert, fireRead, fireRollBack, fireUpdate, getCached, getCacheDataset, getCacheEnvelope, getEnvelope, getFromProjection, getToProjection, getValidShapeTypes, insert, isCachedProjected, projectBackward, projectForward, queryFromCache, readDataset, readDataset, removeDataSourceListener, rollback, setCache, setCached, setFromProjection, setProjection, setToProjection, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tempMaxInt

int tempMaxInt
Constructor Detail

UpdateableSpatialExtenderDataSource

public UpdateableSpatialExtenderDataSource()
Creates new UpdatableSpatialExtenderDataSource

Method Detail

getDatabaseTableName

public java.lang.String getDatabaseTableName()
Return the table name from which to retrieve data from spatial extender


setDatabaseTableName

public void setDatabaseTableName(java.lang.String inDatabaseTableName)
set the table name from which to retrieve data from spatial extender


connect

public java.sql.Connection connect()
                            throws java.lang.Exception
Connects this datasource to the database, calls the connect in the super class.

Overrides:
connect in class SpatialExtenderDataSource
Throws:
java.lang.Exception

requestUpdateConnection

public java.sql.Connection requestUpdateConnection()
                                            throws java.sql.SQLException
Get a connection that can be used for updates.

Throws:
java.sql.SQLException

releaseUpdateConnection

public void releaseUpdateConnection()
                             throws java.sql.SQLException
Return the update connection.

Throws:
java.sql.SQLException

doInsert

public void doInsert(Record inRecord)
              throws java.lang.Exception
Inserts the given record into the datasource.

Overrides:
doInsert in class SimpleDataSource
Throws:
java.lang.Exception

doUpdate

public void doUpdate(Record inRecord)
              throws java.lang.Exception
Update the data source with the changed record.

Overrides:
doUpdate in class SimpleDataSource
Throws:
java.lang.Exception

doDelete

public void doDelete(Record inRecord)
              throws java.lang.Exception
Delete this record from the database.

Overrides:
doDelete in class SimpleDataSource
Throws:
java.lang.Exception

doCommit

public void doCommit()
              throws java.lang.Exception
Commit all changes since the last commit.

Overrides:
doCommit in class SimpleDataSource
Throws:
java.lang.Exception

doRollback

public void doRollback()
                throws java.lang.Exception
Rollback any changes to this datasource since the last commit.

Overrides:
doRollback in class SimpleDataSource
Throws:
java.lang.Exception

readShapes

public GISDataset readShapes(Envelope inEnvelope)
                      throws java.lang.Exception
Reads the objects from the database that fall within the given Envelope. If a null is sent in for the Envelope, all the objects in the shape file are read.

Specified by:
readShapes in class SimpleDataSource
Throws:
java.lang.Exception

isUpdateable

public boolean isUpdateable()
Returns true.

Specified by:
isUpdateable in interface DataSource
Overrides:
isUpdateable in class SimpleDataSource

getNode

public Node getNode()
Get the configuration information for this data source

Specified by:
getNode in interface DataSource
Overrides:
getNode in class SpatialExtenderDataSource

setNode

public void setNode(Node inNode)
             throws java.lang.Exception
Set the configuration information for this data source

Specified by:
setNode in interface DataSource
Overrides:
setNode in class SpatialExtenderDataSource
Throws:
java.lang.Exception

getStyle

public Style getStyle()
Get the style to use with this datasource.

Specified by:
getStyle in interface DataSource
Overrides:
getStyle in class SimpleDataSource