public class IlvJDBCSDMModel extends IlvMultipleSDMModel
This class is merely a shortcut for easily creating a JDBC model in the common case where there are only two tables (one for nodes, and another one for links), and where both tables are read from the same database. You must specify the column in the node table that contains the identifiers of the nodes, and the columns in the link table that contain the source and destination of the links.
This class just puts together instances of
IlvJDBCTableModel
and IlvTableSDMModel
, and combines them into an
IlvMultipleSDMModel
in the simple case described below.
To build a JDBC SDM model in more complex cases (for example, if there are
more than two tables, or if the tables are not read from the same database,
or to define more complex mappings between table columns and properties
of SDM objects), you must use these classes directly.
IlvTableSDMModel
,
IlvMultipleSDMModel
,
IlvJDBCTableModel
,
Serialized FormIlvMultipleSDMModel.OwnedObject
Constructor and Description |
---|
IlvJDBCSDMModel(String databaseURL,
String user,
String passwd,
String driverName,
String nodesQuery,
Object[] nodesQueryParameters,
String nodesIdColumn,
String linksQuery,
Object[] linksQueryParameters,
String linksSourceColumn,
String linksDestinationColumn)
Creates a new JDBC SDM model that contains one table for nodes and
one table for links.
|
IlvJDBCSDMModel(String databaseURL,
String user,
String passwd,
String driverName,
String nodesQuery,
String nodesIdColumn,
String linksQuery,
String linksSourceColumn,
String linksDestinationColumn)
Creates a new JDBC SDM model that contains one table for nodes and
one table for links.
|
addModel, addModel, addObject, adjustmentFinished, clear, createLink, createNode, dataChanged, getChildren, getFrom, getID, getIDImpl, getModel, getModels, getObject, getObjectProperty, getObjectPropertyNames, getObjects, getParent, getTag, getTo, isAdjusting, isEditable, isLink, linkDestinationChanged, linkSourceChanged, objectAdded, objectRemoved, propertyChanged, removeModel, removeObject, setAdjusting, setFrom, setID, setIDImpl, setModel, setModels, setObjectProperty, setTo
addObjectImpl, addSDMModelListener, addSDMPropertyChangeListener, allocID, contains, fireAdjustmentFinished, fireDataChanged, fireIDChanged, fireLinkDestinationChanged, fireLinkSourceChanged, fireObjectAdded, fireObjectRemoved, firePropertyChanged, firePropertyChanged, removeSDMModelListener, removeSDMPropertyChangeListener
public IlvJDBCSDMModel(String databaseURL, String user, String passwd, String driverName, String nodesQuery, String nodesIdColumn, String linksQuery, String linksSourceColumn, String linksDestinationColumn) throws Exception
databaseURL
- The database URL.user
- The user name used to connect to the database.passwd
- The password used to connect to the database.driverName
- The driver name used to connect to the database.nodesQuery
- The SQL query that returns the table containing the
nodes of the graph. In this query, every parameter
should be validated, to prevent SQL injection attacks.nodesIdColumn
- The name of the column in the node table that
contains the IDs of nodes.linksQuery
- The SQL query that returns the table containing the
links of the graph. In this query, every parameter
should be validated, to prevent SQL injection attacks.linksSourceColumn
- The name of the column in the link table that
contains the source of links.linksDestinationColumn
- The name of the column in the link table that
contains the destination of links.Exception
- If an exception occurs while creating the connection.public IlvJDBCSDMModel(String databaseURL, String user, String passwd, String driverName, String nodesQuery, Object[] nodesQueryParameters, String nodesIdColumn, String linksQuery, Object[] linksQueryParameters, String linksSourceColumn, String linksDestinationColumn) throws Exception
databaseURL
- The database URL.user
- The user name used to connect to the database.passwd
- The password used to connect to the database.driverName
- The driver name used to connect to the database.nodesQuery
- The SQL query that returns the table containing the
nodes of the graph, with a question mark placeholder
for each parameter.nodesQueryParameters
- Parameters of the nodes query.nodesIdColumn
- The name of the column in the node table that
contains the IDs of nodes.linksQuery
- The SQL query that returns the table containing the
links of the graph, with a question mark placeholder
for each parameter.linksQueryParameters
- Parameters of the links query.linksSourceColumn
- The name of the column in the link table that
contains the source of links.linksDestinationColumn
- The name of the column in the link table that
contains the destination of links.Exception
- If an exception occurs while creating the connection.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.