GIS_DB_Factory.java [src/java/c] Revision:   Date:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package c;

import csip.Config;
import java.sql.Connection;
import java.sql.SQLException;
import org.apache.commons.lang.NotImplementedException;

/**
 *
 * @author scase
 */
public class GIS_DB_Factory { 
    
    public static GIS_DB createGISEngine() throws Exception {
        //TODO:  This section reserved for future use when an GISObjectConsumer is created that does not use a database engine to conduct GIS operations.
        GIS_DB ret_val = null;

        // Return pg connection, unless mssql is specified in config param
        String db = Config.getString("conservation_resources.database", "pg");
        if (db.contentEquals("mssql")) {
            ret_val = new MsSQLGIS();
        }
        else {
            //ret_val = PostGIS.singleton();
            throw new NotImplementedException("Unsupported DBMS type specified.");
        }
        
        return ret_val;
    }

}