ilog.views.diagrammer.datasource
Class IlvJDBCDataSource

java.lang.Object
  extended by ilog.views.diagrammer.datasource.IlvDiagrammerDataSource
      extended by ilog.views.diagrammer.datasource.IlvJDBCDataSource

public class IlvJDBCDataSource
extends IlvDiagrammerDataSource

A JDBC data source for the diagram component.

A JDBC data source reads data into a diagram component from a database.

A JDBC data source is defined by a set of queries. Each query is a table read from a database which returns a set of nodes or links.


Nested Class Summary
static class IlvJDBCDataSource.QueryParameters
          This class is used to store the parameters of a query for a Diagrammer JDBC data source.
 
Constructor Summary
IlvJDBCDataSource()
           
 
Method Summary
 void addQuery(IlvJDBCDataSource.QueryParameters query)
          Adds a query to this data source.
protected  void deserializeImpl(Element element)
          Deserializes the parameters of this data source from the specified DOM element.
 String getDescription()
          Returns the URL used to connect to the database.
 Collection getQueries()
          Returns the queries of this data source.
 void read(IlvDiagrammer diagrammer)
          Executes the database queries and sends the resulting data to the diagram component for rendering.
 void removeAllQueries()
          Removes all the queries from this data source.
 void removeQuery(IlvJDBCDataSource.QueryParameters query)
          Removes a query from this data source.
protected  void serializeImpl(Element element)
          Serializes the parameters of this data source to the specified DOM element.
 void write(IlvDiagrammer diagrammer)
          Throws an exception because JDBC data sources do not support writing.
 
Methods inherited from class ilog.views.diagrammer.datasource.IlvDiagrammerDataSource
deserialize, getBaseURL, serialize, supportsWrite
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvJDBCDataSource

public IlvJDBCDataSource()
Method Detail

addQuery

public void addQuery(IlvJDBCDataSource.QueryParameters query)
Adds a query to this data source. The query is defined by an instance of the inner class IlvJDBCDataSource.QueryParameters.

Parameters:
query - The query to add to this data source.

removeQuery

public void removeQuery(IlvJDBCDataSource.QueryParameters query)
Removes a query from this data source. The query is defined by an instance of the inner class IlvJDBCDataSource.QueryParameters.

Parameters:
query - The query to remove from this data source.

getQueries

public Collection getQueries()
Returns the queries of this data source.

Returns:
A Collection of IlvJDBCDataSource.QueryParameters.

removeAllQueries

public void removeAllQueries()
Removes all the queries from this data source.


read

public void read(IlvDiagrammer diagrammer)
          throws IlvDiagrammerException
Executes the database queries and sends the resulting data to the diagram component for rendering.

Specified by:
read in class IlvDiagrammerDataSource
Parameters:
diagrammer - The diagram component that will display the data read from this data source.
Throws:
IlvDiagrammerException - If an exception occurs while reading data. This exception will usually contain a "cause", that is, the original low-level exception that caused the data source to fail to complete the operation.

write

public void write(IlvDiagrammer diagrammer)
           throws IlvDiagrammerException
Throws an exception because JDBC data sources do not support writing.

Specified by:
write in class IlvDiagrammerDataSource
Parameters:
diagrammer - The diagram component that contains the data to be saved to the data source.
Throws:
IlvDiagrammerException - If an exception occurs while writing data. This exception will usually contain a "cause", that is to say the original low-level exception that caused the data source to fail to complete the operation.

getDescription

public String getDescription()
Returns the URL used to connect to the database.

Overrides:
getDescription in class IlvDiagrammerDataSource

serializeImpl

protected void serializeImpl(Element element)
                      throws IlvDiagrammerException
Serializes the parameters of this data source to the specified DOM element.

Specified by:
serializeImpl in class IlvDiagrammerDataSource
Parameters:
element - The DOM element to which the data source parameters are written.
Throws:
IlvDiagrammerException - If an exception occurs while serializing the data source.

deserializeImpl

protected void deserializeImpl(Element element)
                        throws IlvDiagrammerException
Deserializes the parameters of this data source from the specified DOM element.

Specified by:
deserializeImpl in class IlvDiagrammerDataSource
Parameters:
element - The DOM element to which the data source parameters are written.
Throws:
IlvDiagrammerException - If an exception occurs while deserializing the data source.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.