gistoolkit.datasources.mysql
Class UpdateableMySQLDataSource

java.lang.Object
  extended bygistoolkit.datasources.SimpleDataSource
      extended bygistoolkit.datasources.SimpleDBDataSource
          extended bygistoolkit.datasources.mysql.MySQLDataSource
              extended bygistoolkit.datasources.mysql.UpdateableMySQLDataSource
All Implemented Interfaces:
DataSource

public class UpdateableMySQLDataSource
extends MySQLDataSource

Reads the shapes from a single table. This allows the shapes to be updated along with the attribute data without the confusion of adding additonal joins.


Field Summary
 
Fields inherited from class gistoolkit.datasources.SimpleDataSource
 
Constructor Summary
UpdateableMySQLDataSource()
          Creates new UpdateableMySQLDataSource
 
Method Summary
 void commit()
          Commit all changes since the last commit.
 java.sql.Connection connect()
          Connect this datasource to the database
 void doDelete(Record inRecord)
          Delete this record from the database.
 void doInsert(Record inRecord)
          Inserts the given record into the datasource.
 void doUpdate(Record inRecord)
          Update the data source with the changed record.
 java.lang.String getDatabaseTablename()
          return the tablename to use when accessing the data source
 Node getNode()
          Get the configuration information for this data source
 Style getStyle()
          Get the style to use with this datasource.
 java.lang.String[] getValidShapeTypes()
          Return the valid shapes for this data source
 boolean isUpdateable()
          Determines if this datasource is updateable.
protected  GISDataset readShapes(Envelope inEnvelope)
          This method returns the shapes from the data source
 void rollback()
          Rollback any changes to this datasource since the last commit.
 void setDatabaseTablename(java.lang.String inDatabaseTablename)
          Set the table name to use when accessing the data source
 void setNode(Node inNode)
          Set the configuration information for this data source
 
Methods inherited from class gistoolkit.datasources.mysql.MySQLDataSource
closeConnection, finalize, getDatabaseName, getDatabasePassword, getDatabasePort, getDatabaseServername, getDatabaseShapeColumn, getDatabaseSpatialReferenceID, getDatabaseURLBase, getDatabaseUsername, getSQLConverter, load, readEnvelope, setDatabaseName, setDatabasePassword, setDatabasePort, setDatabaseServername, setDatabaseShapeColumn, setDatabaseSpatialReferenceID, setDatabaseSpatialReferenceID, setDatabaseURLBase, setDatabaseUsername
 
Methods inherited from class gistoolkit.datasources.SimpleDBDataSource
getFilter, getFilterSQL, setFilter
 
Methods inherited from class gistoolkit.datasources.SimpleDataSource
addDataSourceListener, clearCache, delete, doCommit, doRollback, filterDataset, fireCommit, fireDelete, fireInsert, fireRead, fireRollBack, fireUpdate, getCached, getCacheDataset, getCacheEnvelope, getEnvelope, getFromProjection, getName, getToProjection, insert, isCachedProjected, projectBackward, projectForward, queryFromCache, readDataset, readDataset, removeDataSourceListener, setCache, setCached, setFromProjection, setName, setProjection, setToProjection, update
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdateableMySQLDataSource

public UpdateableMySQLDataSource()
Creates new UpdateableMySQLDataSource

Method Detail

setDatabaseTablename

public void setDatabaseTablename(java.lang.String inDatabaseTablename)
Set the table name to use when accessing the data source


getDatabaseTablename

public java.lang.String getDatabaseTablename()
return the tablename to use when accessing the data source


getValidShapeTypes

public java.lang.String[] getValidShapeTypes()
Return the valid shapes for this data source

Overrides:
getValidShapeTypes in class SimpleDataSource

connect

public java.sql.Connection connect()
                            throws java.lang.Exception
Description copied from class: MySQLDataSource
Connect this datasource to the database

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

readShapes

protected GISDataset readShapes(Envelope inEnvelope)
                         throws java.lang.Exception
This method returns the shapes from the data source

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

getNode

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

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

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 MySQLDataSource
Throws:
java.lang.Exception

isUpdateable

public boolean isUpdateable()
Determines if this datasource is updateable. By default it is not, so this method always returns true to override the super class.

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

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. By default this is a read only data source, so this method does nothing.

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. By default this is a read only data source, so this method does nothing.

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

commit

public void commit()
            throws java.lang.Exception
Commit all changes since the last commit. This is a read only data source by default, so this method does nothing.

Specified by:
commit in interface DataSource
Overrides:
commit in class SimpleDataSource
Throws:
java.lang.Exception

rollback

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

Specified by:
rollback in interface DataSource
Overrides:
rollback in class SimpleDataSource
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