nl.itc.RIMapper
Class DBconn
java.lang.Object
nl.itc.RIMapper.DBconn
public class DBconn
- extends Object
Utility class for opening, closing and querying connections to databases that support
the OGC SFS (Simple Features for SQL) specification.
This version supports
PostgreSQL/PostGIS and MySQL.
©2004-12 International Institute for
Geo-information Science and Earth Observation (ITC)
Licensed under a Creative
Commons Attribution-NonCommercial-ShareAlike 2.5 License. see
http://creativecommons.org/licenses/by-nc-sa/2.5/
- Version:
- 1.1 [Feb 2012]
- Author:
- Barend Köbben - kobben@itc.nl
DBconn
public DBconn()
Open
public boolean Open(String SFSserver,
String HOST,
String DB,
String UN,
String PW)
throws RIMapperException
- Parameters:
SFSserver - name of the DB server to connect to.
Only "MySQL" or "PostGIS" accepted.HOST - address of the host to connect to (localhost or someserver.domain.com)DB - name of the database to connect to.UN - username for DB connection.PW - password for DB connection.
- Returns:
- true if successful, false if not.
- Throws:
RIMapperException
Query
public ResultSet Query(String SQL)
throws SQLException
- Parameters:
SQL - SQL query to run against open DB connection.
- Returns:
- ResultSet object.
- Throws:
SQLException
Close
public void Close(String SFSserver,
String HOST)
throws RIMapperException
- Closes DB connection.
- Throws:
RIMapperException