|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.geotools.metadata.sql.MetadataSource
A connection to a metadata database. The metadata database can be created
using one of the scripts suggested in GeoAPI, for example
create.sql.
Then, in order to get for example a telephone number, the following code
may be used.
where is the primary key value for the desired record in the table.import org.opengis.metadata.citation.Telephone; ... Connection connection = ... MetadataSource source = new MetadataSource(connection); Telephone telephone = (Telephone) source.getEntry(Telephone.class, id);
| Constructor Summary | |
MetadataSource(java.sql.Connection connection)
Creates a new metadata source. |
|
| Method Summary | |
void |
close()
Close all connections used in this object. |
java.lang.Object |
getEntry(java.lang.Class type,
java.lang.String identifier)
Returns an implementation of the specified metadata interface filled with the data referenced by the specified identifier. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MetadataSource(java.sql.Connection connection)
connection - The connection to the database.| Method Detail |
public java.lang.Object getEntry(java.lang.Class type,
java.lang.String identifier)
throws java.sql.SQLException
CodeList element.
type - The interface to implement (e.g.
Citation), or
the CodeList.identifier - The identifier used in order to locate the record for
the metadata entity to be created. This is usually the primary key
of the record to search for.
java.sql.SQLException - if a SQL query failed.
public void close()
throws java.sql.SQLException
java.sql.SQLException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||