gistoolkit.datasources.oracle
Class ReadOnlyOracleDataSource

java.lang.Object
  extended bygistoolkit.datasources.SimpleDataSource
      extended bygistoolkit.datasources.SimpleDBDataSource
          extended bygistoolkit.datasources.oracle.OracleDataSource
              extended bygistoolkit.datasources.oracle.ReadOnlyOracleDataSource
All Implemented Interfaces:
DataSource

public class ReadOnlyOracleDataSource
extends OracleDataSource
implements DataSource

Class used to allow selects from an oracle database. This class uses the Oracle Locator features that are shipped with oracle databases 8i and above. Complex queries can be generated with this class that involve sub tables, sorts, multiple table joins, and attribute where clauses. This gives the user a great deal of flexability when retrieving information from the database. Because it would be very dificult or imposible to properly update the tables, updates are not allowed with this data source.


Field Summary
 java.lang.String myDatabaseQuery
          The string to apply to select the data from DB2.
 
Fields inherited from class gistoolkit.datasources.oracle.OracleDataSource
myCon, myDatabaseName, myEnvelope, myStmt
 
Fields inherited from class gistoolkit.datasources.SimpleDataSource
 
Constructor Summary
ReadOnlyOracleDataSource()
          SpatialExtenderDataSource constructor comment.
 
Method Summary
 java.sql.Connection connect()
          Connects this datasource to the database, calls the connect in the super class.
 java.lang.String getDatabaseQuery()
          retrieve the sql string that defines the layer.
 Node getNode()
          Get the configuration information for this data source
 boolean getPreread()
          Returns the preread flag.
 Style getStyle()
          Get the style to use with this datasource.
 GISDataset readDataset(Envelope inEnvelope)
          Reads only the objects from the data source that intersect these Envelope.
 GISDataset readShapes(Envelope inEnvelope)
          Reads the objects from the database that fall within the given Envelope.
 void setDatabaseQuery(java.lang.String inQuery)
          sets the sql string that defines this layer.
 void setNode(Node inNode)
          Set the configuration information for this data source
 void setPreread(boolean inPreread)
          Sets the preread flag to tell this data source to preread the entire contents of the layer, and keep them in memory, essentially caching them, until the data source is disposed.
 
Methods inherited from class gistoolkit.datasources.oracle.OracleDataSource
getDatabaseDriver, getDatabaseName, getDatabasePassword, getDatabasePort, getDatabaseSchema, getDatabaseServername, getDatabaseShapeColumn, getDatabaseSpatialReferenceID, getDatabaseURLBase, getDatabaseUsername, getName, getSQLConverter, getWhereString, parseGISToolkitShape, parseSDOStruct, 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, doCommit, doDelete, doInsert, doRollback, doUpdate, filterDataset, fireCommit, fireDelete, fireInsert, fireRead, fireRollBack, fireUpdate, getCached, getCacheDataset, getCacheEnvelope, getEnvelope, getFromProjection, getToProjection, getValidShapeTypes, insert, isCachedProjected, isUpdateable, projectBackward, projectForward, queryFromCache, 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
 
Methods inherited from interface gistoolkit.datasources.DataSource
addDataSourceListener, commit, delete, getEnvelope, getFilter, getFromProjection, getName, getToProjection, insert, isUpdateable, readDataset, removeDataSourceListener, rollback, setFilter, setFromProjection, setName, setToProjection, update
 

Field Detail

myDatabaseQuery

public java.lang.String myDatabaseQuery
The string to apply to select the data from DB2.

Constructor Detail

ReadOnlyOracleDataSource

public ReadOnlyOracleDataSource()
SpatialExtenderDataSource constructor comment.

Method Detail

getDatabaseQuery

public java.lang.String getDatabaseQuery()
retrieve the sql string that defines the layer.


setDatabaseQuery

public void setDatabaseQuery(java.lang.String inQuery)
sets the sql string that defines this layer.


setPreread

public void setPreread(boolean inPreread)
Sets the preread flag to tell this data source to preread the entire contents of the layer, and keep them in memory, essentially caching them, until the data source is disposed.


getPreread

public boolean getPreread()
Returns the preread flag. This flag tells the data source to preread the entire contents of the layer, and to cach that information in memory until the data source is disposed.


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

readDataset

public GISDataset readDataset(Envelope inEnvelope)
                       throws java.lang.Exception
Reads only the objects from the data source that intersect these Envelope. This is heare instead of in the super class because of the preread logic.

Specified by:
readDataset in interface DataSource
Overrides:
readDataset 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

getNode

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

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

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 OracleDataSource
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