nl.itc.RIMapper
Class DBconn

java.lang.Object
  extended by 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

Constructor Summary
DBconn()
           
 
Method Summary
 void Close(String SFSserver, String HOST)
          Closes DB connection.
 boolean Open(String SFSserver, String HOST, String DB, String UN, String PW)
           
 ResultSet Query(String SQL)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBconn

public DBconn()
Method Detail

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