GIS_DB_Factory.java [src/java/c] Revision: de7488dfead3cae6dab34c9b762b87099d195ac6 Date: Mon May 16 13:35:05 MDT 2016
/*
* 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. " + connection.getMetaData().getDatabaseProductName() + " is not implemented.");
}
return ret_val;
}
}