Revision 576 trunk/org.gvsig.postgresql/org.gvsig.postgresql.provider/src/main/java/org/gvsig/postgresql/dal/PostgreSQLHelper.java

View differences:

PostgreSQLHelper.java
17 17
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCHelperBase;
18 18
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase;
19 19
import org.gvsig.fmap.dal.store.jdbc2.spi.SRSSolverBase;
20
import org.gvsig.fmap.dal.store.jdbc2.spi.SRSSolverDumb;
20 21
import org.gvsig.postgresql.dal.operations.PostgreSQLOperationsFactory;
21 22
import org.slf4j.Logger;
22 23
import org.slf4j.LoggerFactory;
......
182 183

  
183 184
    private ConnectionProvider connectionProvider = null;
184 185
   
186
    public PostgreSQLHelper() {
187
        super(null);
188
        this.srssolver = new SRSSolverDumb(this);
189
    }
190

  
185 191
    public PostgreSQLHelper(JDBCConnectionParameters connectionParameters) {
186 192
        super(connectionParameters);
187 193
        this.srssolver = new SRSSolverBase(this);
......
191 197
    public Connection getConnection() throws AccessResourceException {
192 198
        try {
193 199
            if (this.connectionProvider == null) {
194
                this.connectionProvider = new ConnectionProvider(this.getConnectionParameters());
200
              if( this.getConnectionParameters()==null ) {
201
                return null;
202
              }
203
              this.connectionProvider = new ConnectionProvider(this.getConnectionParameters());
195 204
            }
196 205
            return this.connectionProvider.getConnection();
197 206
        } catch (SQLException ex) {
......
201 210

  
202 211
    @Override
203 212
    public void closeConnection(Connection connection) {
213
      if( connection!=null ) { // In test ???
204 214
         this.connectionProvider.closeConnection(connection);
215
      }
205 216
    }
206 217
    
207 218
    @Override

Also available in: Unified diff