HEADER

ru.biosoft.access
Class SqlDataCollection

ru.biosoft.access.DataElementSupport
  |
  +--ru.biosoft.access.AbstractDataCollection
        |
        +--ru.biosoft.access.SqlDataCollection

public class SqlDataCollection
extends AbstractDataCollection

DataCollection which store all information in SQL DBMS.

See Also: DataCollection, SqlTransformer

Field Summary
 final static StringJDBC_DRIVER_PROPERTY
          Property for storing class of jdbc driver.
 final static StringJDBC_PASSWORD_PROPERTY
          Property for storing user password for connecting to the DBMS.
 final static StringJDBC_URL_PROPERTY
          Property for storing driver specific URL for connecting to the DBMS.
 final static StringJDBC_USER_PROPERTY
          Property for storing user name for connecting to the DBMS.
 final static StringTRANSFORMER_CLASS_PROPERTY
          Property for storing class of that should be used for converting DataElements to/from DBMS.

Constructor Summary
SqlDataCollection(DataCollection parent, Properties properties)
          Standart constructor for creating data collection.

Method Summary
 voidclose()
          Close connection to DBMS.
 booleancontains(String name)
          Returns true if data collection contain element with the specified name.
 final ConnectiongetConnection()
          Return active connection.
 ClassgetDataElementType()
          Return type of DataElement stored in this data collection.
 ListgetNameList()
           
 intgetSize()
          Returns size of data collection.
 SqlTransformergetTransformer()
           
 booleanisMutable()
          Returns true if this data collection is mutable.
 Iteratoriterator()
          Returns an iterator over the data elements in this collection.

Methods inherited from class ru.biosoft.access.AbstractDataCollection
addDataCollectionListener, contains, get, getCompleteName, getDescription, getInfo, isNotificationEnabled, isPropagationEnabled, propagateElementChanged, propagateElementWillChange, put, release, remove, removeDataCollectionListener, setNotificationEnabled, setPropagationEnabled, toString

Methods inherited from class ru.biosoft.access.DataElementSupport
getName, getOrigin, registerConstructorWithBadEqual

Field Detail

JDBC_DRIVER_PROPERTY

public final static String JDBC_DRIVER_PROPERTY
Property for storing class of jdbc driver.

JDBC_PASSWORD_PROPERTY

public final static String JDBC_PASSWORD_PROPERTY
Property for storing user password for connecting to the DBMS.

JDBC_URL_PROPERTY

public final static String JDBC_URL_PROPERTY
Property for storing driver specific URL for connecting to the DBMS.

JDBC_USER_PROPERTY

public final static String JDBC_USER_PROPERTY
Property for storing user name for connecting to the DBMS.

TRANSFORMER_CLASS_PROPERTY

public final static String TRANSFORMER_CLASS_PROPERTY
Property for storing class of that should be used for converting DataElements to/from DBMS.
Constructor Detail

SqlDataCollection

public SqlDataCollection(DataCollection parent, Properties properties)
throws java.lang.ClassNotFoundException,
java.sql.SQLException,
java.lang.InstantiationException,
java.lang.IllegalAccessException
Standart constructor for creating data collection. Used by CollectionFactory.
Parameters:
parent - Parent collection.
properties - Properties for creating collection (cannot be null).
See Also:
JDBC_DRIVER_PROPERTY, JDBC_URL_PROPERTY, JDBC_USER_PROPERTY, JDBC_PASSWORD_PROPERTY, TRANSFORMER_CLASS_PROPERTY
Method Detail

close

public void close()
throws java.lang.Exception
Close connection to DBMS. Invalidates SQLDataCollection instance.
Throws:
Exception

contains

public boolean contains(String name)
Returns true if data collection contain element with the specified name.

getConnection

public final Connection getConnection()
throws java.sql.SQLException
Return active connection. Connect if necessary.
Returns: Active connection.
Throws:
java.sql.SQLException - If operation on DBMS failed.

getDataElementType

public Class getDataElementType()
Return type of DataElement stored in this data collection. Really ask transformer for extract template type.
Returns: Type of DataElement stored in this data collection.
See Also:
SqlTransformer

getNameList

public List getNameList()

getSize

public int getSize()
Returns size of data collection. This implementation execute SQL query for extract record count.
Returns: size of data collection.

getTransformer

public SqlTransformer getTransformer()

isMutable

public boolean isMutable()
Returns true if this data collection is mutable. Check Connection is read only or not.
Returns: whether this collection is mutable.
See Also:
Connection

iterator

public Iterator iterator()
Returns an iterator over the data elements in this collection. There are no guarantees concerning the order in which the elements are returned. If the data collection is modified while an iteration over it is in progress, the results of the iteration are undefined.
See Also:
SQLDataCollection.SQLIterator

Association Links

to Class java.lang.String

Property for storing class of jdbc driver.

to Class java.lang.String

Property for storing driver specific URL for connecting to the DBMS.

to Class java.lang.String

Property for storing user name for connecting to the DBMS.

to Class java.lang.String

Property for storing user password for connecting to the DBMS.

to Class java.lang.String

Property for storing class of that should be used for converting DataElements to/from DBMS.

to Class java.sql.Connection

Connection to DBMS.

to Class ru.biosoft.access.SqlTransformer

Transformer for converting DataElements to/from DBMS.

FOOTER

BOTTOM