Revision 43687 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.db/org.gvsig.fmap.dal.db.jdbc/src/main/java/org/gvsig/fmap/dal/store/jdbc2/spi/JDBCHelperBase.java

View differences:

JDBCHelperBase.java
5 5
import java.sql.Connection;
6 6
import java.sql.ResultSet;
7 7
import org.apache.commons.lang3.StringUtils;
8
import org.cresques.cts.IProjection;
9
import org.gvsig.fmap.crs.CRSFactory;
10 8
import org.gvsig.fmap.dal.DataTypes;
11 9
import org.gvsig.fmap.dal.exception.DataException;
12 10
import org.gvsig.fmap.dal.exception.InitializeException;
......
120 118

  
121 119
    @Override
122 120
    public JDBCSQLBuilderBase createSQLBuilder() {
123
        return new JDBCSQLBuilderBase();
121
        return new JDBCSQLBuilderBase(this);
124 122
    }
125 123

  
126 124
    @Override
......
337 335
        }
338 336
        return !StringUtils.isEmpty(this.store.getParameters().getSQL());
339 337
    }  
340

  
341
    @Override
342
    public int getSRSCode(IProjection crs) {
343
        Connection connection=null;
344
        try {
345
            connection = this.getConnection();
346
            String databaseCode = this.srssolver.getDatabaseCode(connection, crs.getAbrev());
347
            return Integer.parseInt(databaseCode);
348
        } catch(Throwable ex) {
349
            throw new RuntimeException(ex);
350
        } finally {
351
            this.closeConnection(connection);
352
        }
353
    }
354

  
355
    @Override
356
    public IProjection getProjectionFromSRSId(int srsid) {
357
        return getProjectionFromDatabaseCode(String.valueOf(srsid));
358
    }
359

  
360
    @Override
361
    public String getDatabaseCodeFromProyection(IProjection proj) {
362
        Connection connection=null;
363
        try {
364
            connection = this.getConnection();
365
            return this.srssolver.getDatabaseCode(connection, proj);
366
        } catch(Throwable ex) {
367
            throw new RuntimeException(ex);
368
        } finally {
369
            this.closeConnection(connection);
370
        }
371
    }
372 338
    
373 339
    @Override
374 340
    public SRSSolver getSRSSolver() {
......
376 342
    }
377 343
    
378 344
    @Override
379
    public IProjection getProjectionFromDatabaseCode(String databaseCode) {
380
        Connection connection=null;
381
        try {
382
            connection = this.getConnection();
383
            return this.srssolver.getProjection(connection, databaseCode);
384
        } catch(Throwable ex) {
385
            throw new RuntimeException(ex);
386
        } finally {
387
            this.closeConnection(connection);
388
        }
389
    }
390
    
391
    @Override
392 345
    public JDBCStoreProvider createProvider(
393 346
            JDBCStoreParameters parameters, 
394 347
            DataStoreProviderServices providerServices

Also available in: Unified diff