|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgistoolkit.datasources.SimpleDataSource
gistoolkit.datasources.SimpleJoinDataSource
gistoolkit.datasources.SimpleJoinDBDataSource
gistoolkit.datasources.db2spatialextender.DB2JoinDataSource
Class to join a DB2 Datatable to another data source. Why would you do this? Because it may be more efficient to read shapes from a shape file layer which can cache then on the server, and do the join in this layer. This will prevent the rereading of the shapes from the database each time that the values are needed. Reading the shapes from a shape file in most cases, is much faster than reading them from DB2. This may change with version 8 of the db2 spatial extender. To use this class, first create the data source used to read the shapes. This data source may be of any type, and can read the shapes from any of the data sources. Then create the DB2JoinDataSource with the source data source as it's source. This data source will need to know which attributes it should join on Set the column from the source data that is to be used with the setDatasourceJoinColumn method, and set the column for this data source with the setTableJoinColumn method. The data source will loop through the records returned. The data source first reads the data from the source datasource, then it compares the data from the join data source to that of the source data source, and throws away any that do not have a match. It also trims the source data source to the envelope. This results in a standard inner join between the source data, and the join data.
Field Summary | |
protected java.sql.Connection |
myCon
Connection to the DB2 datasource used for maintaining persistent connections. |
java.lang.String |
myDatabaseName
The name of the database on the DB2 server to connect to. |
protected java.sql.Statement |
myStmt
Statment used to maintain distributed transactions. |
Fields inherited from class gistoolkit.datasources.SimpleDataSource |
|
Constructor Summary | |
DB2JoinDataSource()
For use with configuration only where the source data source is to be set with the setNode() function. |
|
DB2JoinDataSource(DataSource inSourceDataSource)
Create a new DB2JoinDataSource with this data source as the source node. |
Method Summary | |
void |
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 |
getDatabaseQuery()
SQL Query to use in retrieving data from the database. |
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 |
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 |
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. |
Style |
getStyle()
Get the style to use with this datasource. |
GISDataset |
readShapes(Envelope inEnvelope)
Reads the objects from the database that fall within the given Envelope. |
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 |
setDatabaseQuery(java.lang.String inQuery)
SQL Query to use to retrieve data from the database. |
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 |
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.SimpleJoinDBDataSource |
getFilter, getFilterSQL, setFilter |
Methods inherited from class gistoolkit.datasources.SimpleJoinDataSource |
getDatasourceJoinColumn, getDatasourceRecord, getJoinDataSource, getJoinDataSourceAttributeNames, getJoinDataSourceAttributeTypes, getJoinedDataCached, getTableJoinColumn, readDataSource, readEnvelope, setDatasourceJoinColumn, setJoinedDataCached, setTableJoinColumn |
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, 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 |
public java.lang.String myDatabaseName
protected java.sql.Connection myCon
protected java.sql.Statement myStmt
Constructor Detail |
public DB2JoinDataSource()
public DB2JoinDataSource(DataSource inSourceDataSource)
Method Detail |
public java.lang.String getName()
getName
in interface DataSource
getName
in class SimpleDataSource
public void setName(java.lang.String inName)
setName
in interface DataSource
setName
in class SimpleDataSource
public java.lang.String getDatabaseURLBase()
public void setDatabaseURLBase(java.lang.String inDatabaseURLBase)
public java.lang.String getDatabaseDriver()
public void setDatabaseDriver(java.lang.String inDatabaseDriver)
public java.lang.String getDatabaseServername()
public void setDatabaseServername(java.lang.String inDatabaseServername)
public java.lang.String getDatabaseName()
public void setDatabaseName(java.lang.String inDatabaseName)
public java.lang.String getDatabaseSchema()
public void setDatabaseSchema(java.lang.String inDatabaseSchema)
public java.lang.String getDatabaseUsername()
public void setDatabaseUsername(java.lang.String inDatabaseUsername)
public java.lang.String getDatabasePassword()
public void setDatabasePassword(java.lang.String inDatabasePassword)
public int getDatabasePort()
public void setDatabasePort(int inDatabasePort)
public void setDatabaseQuery(java.lang.String inQuery)
public java.lang.String getDatabaseQuery()
public void connect() throws java.lang.Exception
java.lang.Exception
public SQLConverter getSQLConverter()
getSQLConverter
in class SimpleJoinDBDataSource
public GISDataset readShapes(Envelope inEnvelope) throws java.lang.Exception
readShapes
in class SimpleJoinDataSource
java.lang.Exception
public Node getNode()
getNode
in interface DataSource
getNode
in class SimpleJoinDataSource
public void setNode(Node inNode) throws java.lang.Exception
setNode
in interface DataSource
setNode
in class SimpleJoinDataSource
java.lang.Exception
public Style getStyle()
getStyle
in interface DataSource
getStyle
in class SimpleDataSource
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |