Package viewer.base
Class DatabaseLayer
java.lang.Object
viewer.base.Layer
viewer.base.DatabaseLayer
public class DatabaseLayer extends Layer
This class represents a layer enabling a database connection
- Author:
- Jan-Henrik Haunert
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DatabaseLayer(java.sql.Statement st, SymbolFactory factory, java.lang.String tablename, java.lang.String geocolumnname) -
Method Summary
Modifier and Type Method Description protected java.util.List<Symbol>executeQuery(java.lang.String query)The method sends the query to the database using the class attribute st and creates a List of Symbols from the ResultSet.java.lang.StringgetGeocolname()intgetSrid()java.sql.StatementgetSt()java.lang.StringgetTablename()java.util.List<Symbol>query(Envelope searchEnv)Queries all symbols whose bounding boxes intersect the search envelope
-
Constructor Details
-
DatabaseLayer
public DatabaseLayer(java.sql.Statement st, SymbolFactory factory, java.lang.String tablename, java.lang.String geocolumnname)- Parameters:
st- statement for the execution of an SQL queryfactory- symbol factory objecttablename- table namegeocolumnname- column of the geometry
-
-
Method Details
-
query
Description copied from class:LayerQueries all symbols whose bounding boxes intersect the search envelope -
executeQuery
The method sends the query to the database using the class attribute st and creates a List of Symbols from the ResultSet. We assume that the geometry column that we want to visualize is queried with 'SELECT ST_asText(..) AS geom_wkt'.- Parameters:
query- The parameter String that is send to the database.- Returns:
- mySymbols A List of Symbols that are returned by the database.
-
getSt
public java.sql.Statement getSt() -
getTablename
public java.lang.String getTablename() -
getGeocolname
public java.lang.String getGeocolname() -
getSrid
public int getSrid()
-