gistoolkit.datasources.db2spatialextender
Class SpatialExtenderDataSource

java.lang.Object
  extended bygistoolkit.datasources.SimpleDataSource
      extended bygistoolkit.datasources.SimpleDBDataSource
          extended bygistoolkit.datasources.db2spatialextender.SpatialExtenderDataSource
All Implemented Interfaces:
DataSource
Direct Known Subclasses:
ReadOnlySpatialExtenderDataSource, UpdateableSpatialExtenderDataSource

public abstract class SpatialExtenderDataSource
extends SimpleDBDataSource

Super class for the Spatial Extender DataSources. Handles connecting to the database retrieving the valid range of x and y values, and serialization of the connection parameters common to SpatialExtenderDataSources.


Field Summary
static long MAX_DB2_INT
          DB2 stores all of these features as posative integers between 0 and the MAX_DB2_INT.
 java.lang.String myDatabaseName
          The name of the database on the DB2 server to connect to.
protected  Envelope myEnvelope
          The Envelope of the dataset.
 
Fields inherited from class gistoolkit.datasources.SimpleDataSource
 
Constructor Summary
SpatialExtenderDataSource()
          Creates new SpatialExtenderDataSource
 
Method Summary
protected  Point checkMaxPoint(Point inPoint)
          Function to ensure that the X and Y of the point are within the allowable limits
 java.sql.Connection connect()
          Initializes the connection to the database.
 java.lang.String getDatabaseDriver()
          Returns the jdbc driver class used for connection to the database.
 java.lang.String getDatabaseName()
          Returns the name of the DB2 Database.
 java.lang.String getDatabasePassword()
          Returns the password to use when connecting to the DB2 server.
 int getDatabasePort()
          Returns the tcpip port to use when connecting to the DB2 server
 java.lang.String getDatabaseSchema()
          Returns the name of the schema within the DB2 database where the data resides.
 java.lang.String getDatabaseServername()
          Returns the computer name of the DB2 server.
 java.lang.String getDatabaseShapeColumn()
          Returns the name of the shape column.
 int getDatabaseSpatialReferenceID()
          Returns the spatial reference id to use for converting shapes to and from database format.
 java.lang.String getDatabaseURLBase()
          Returns the url base to use when connecting through the JDBC driver.
 java.lang.String getDatabaseUsername()
          Returns the username to use when connecting to the DB2 server.
 java.lang.String getJDBCURL()
          Returns the correctly formated URL for connecting to a db2 database.
 java.lang.String getName()
          Return the name of this datasource for display to the user.
 Node getNode()
          Get the configuration information for this data source
 SQLConverter getSQLConverter()
          Returns the converter for this Database.
protected  java.lang.String getWhereString(Envelope inEnvelope)
          Get the where clause based on the Envelope
 Envelope readEnvelope()
          Returns the bounding rectangle of all the shapes in the Data Source.
 void setDatabaseDriver(java.lang.String inDatabaseDriver)
          Sets the name of the jdbc driver class used for connection to the database.
 void setDatabaseName(java.lang.String inDatabaseName)
          Sets the name of the DB2 Database.
 void setDatabasePassword(java.lang.String inDatabasePassword)
          Sets the password to use when connecting to the DB2 server.
 void setDatabasePort(int inDatabasePort)
          Sets the tcpip port to use when connecting to the DB2 server
 void setDatabaseSchema(java.lang.String inDatabaseSchema)
          Sets the name of the schema within the DB2 database where the data resides.
 void setDatabaseServername(java.lang.String inDatabaseServername)
          Sets the name of the DB2 Server computer.
 void setDatabaseShapeColumn(java.lang.String inDatabaseShapeColumn)
          Sets the name of the shape column.
 void setDatabaseSpatialReferenceID(int inDatabaseSpatialReferenceID)
          Sets the SpatialReferenceID to use when converting shapes to and from database format.
 void setDatabaseSpatialReferenceID(java.lang.String inDatabaseSpatialReferenceID)
          Sets the SpatialReferenceID to use when converting shapes to and from database format.
 void setDatabaseURLBase(java.lang.String inDatabaseURLBase)
          Sets the url base to use when connecting through the JDBC driver.
 void setDatabaseUsername(java.lang.String inDatabaseUsername)
          Sets the username to use when connecting to the DB2 server.
 void setName(java.lang.String inName)
          Set the name of this datasource for display purposes.
 void setNode(Node inNode)
          Set the configuration information for this data source
 
Methods inherited from class gistoolkit.datasources.SimpleDBDataSource
getFilter, getFilterSQL, setFilter
 
Methods inherited from class gistoolkit.datasources.SimpleDataSource
addDataSourceListener, clearCache, commit, delete, doCommit, doDelete, doInsert, doRollback, doUpdate, filterDataset, fireCommit, fireDelete, fireInsert, fireRead, fireRollBack, fireUpdate, getCached, getCacheDataset, getCacheEnvelope, getEnvelope, getFromProjection, getStyle, getToProjection, getValidShapeTypes, insert, isCachedProjected, isUpdateable, projectBackward, projectForward, queryFromCache, readDataset, readDataset, readShapes, 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

myDatabaseName

public java.lang.String myDatabaseName
The name of the database on the DB2 server to connect to.


MAX_DB2_INT

public static long MAX_DB2_INT
DB2 stores all of these features as posative integers between 0 and the MAX_DB2_INT. DB2 throws a nasty exception if the value is out of range, so this number is used to move the bounds such that they can be represented within this range. The maximum is an signed posative 32 bit integer = 2,147,483,647


myEnvelope

protected Envelope myEnvelope
The Envelope of the dataset.

Constructor Detail

SpatialExtenderDataSource

public SpatialExtenderDataSource()
Creates new SpatialExtenderDataSource

Method Detail

getName

public java.lang.String getName()
Return the name of this datasource for display to the user.

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

setName

public void setName(java.lang.String inName)
Set the name of this datasource for display purposes.

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

getDatabaseURLBase

public java.lang.String getDatabaseURLBase()
Returns the url base to use when connecting through the JDBC driver.


setDatabaseURLBase

public void setDatabaseURLBase(java.lang.String inDatabaseURLBase)
Sets the url base to use when connecting through the JDBC driver.


getDatabaseDriver

public java.lang.String getDatabaseDriver()
Returns the jdbc driver class used for connection to the database.


setDatabaseDriver

public void setDatabaseDriver(java.lang.String inDatabaseDriver)
Sets the name of the jdbc driver class used for connection to the database.


getDatabaseServername

public java.lang.String getDatabaseServername()
Returns the computer name of the DB2 server.


setDatabaseServername

public void setDatabaseServername(java.lang.String inDatabaseServername)
Sets the name of the DB2 Server computer.


getDatabaseName

public java.lang.String getDatabaseName()
Returns the name of the DB2 Database.


setDatabaseName

public void setDatabaseName(java.lang.String inDatabaseName)
Sets the name of the DB2 Database.


getDatabaseSchema

public java.lang.String getDatabaseSchema()
Returns the name of the schema within the DB2 database where the data resides.


setDatabaseSchema

public void setDatabaseSchema(java.lang.String inDatabaseSchema)
Sets the name of the schema within the DB2 database where the data resides.


getDatabaseUsername

public java.lang.String getDatabaseUsername()
Returns the username to use when connecting to the DB2 server.


setDatabaseUsername

public void setDatabaseUsername(java.lang.String inDatabaseUsername)
Sets the username to use when connecting to the DB2 server.


getDatabasePassword

public java.lang.String getDatabasePassword()
Returns the password to use when connecting to the DB2 server.


setDatabasePassword

public void setDatabasePassword(java.lang.String inDatabasePassword)
Sets the password to use when connecting to the DB2 server.


getDatabasePort

public int getDatabasePort()
Returns the tcpip port to use when connecting to the DB2 server


setDatabasePort

public void setDatabasePort(int inDatabasePort)
Sets the tcpip port to use when connecting to the DB2 server


getDatabaseShapeColumn

public java.lang.String getDatabaseShapeColumn()
Returns the name of the shape column.


setDatabaseShapeColumn

public void setDatabaseShapeColumn(java.lang.String inDatabaseShapeColumn)
Sets the name of the shape column. The contents of this column will be parsed as a shape.


getDatabaseSpatialReferenceID

public int getDatabaseSpatialReferenceID()
Returns the spatial reference id to use for converting shapes to and from database format.


setDatabaseSpatialReferenceID

public void setDatabaseSpatialReferenceID(int inDatabaseSpatialReferenceID)
Sets the SpatialReferenceID to use when converting shapes to and from database format.


setDatabaseSpatialReferenceID

public void setDatabaseSpatialReferenceID(java.lang.String inDatabaseSpatialReferenceID)
Sets the SpatialReferenceID to use when converting shapes to and from database format.


checkMaxPoint

protected Point checkMaxPoint(Point inPoint)
Function to ensure that the X and Y of the point are within the allowable limits


getJDBCURL

public java.lang.String getJDBCURL()
Returns the correctly formated URL for connecting to a db2 database.


connect

public java.sql.Connection connect()
                            throws java.lang.Exception
Initializes the connection to the database.

Throws:
java.lang.Exception

readEnvelope

public Envelope readEnvelope()
                      throws java.lang.Exception
Returns the bounding rectangle of all the shapes in the Data Source.

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

getWhereString

protected java.lang.String getWhereString(Envelope inEnvelope)
Get the where clause based on the Envelope


getNode

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

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

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

getSQLConverter

public SQLConverter getSQLConverter()
Returns the converter for this Database.

Overrides:
getSQLConverter in class SimpleDBDataSource