Revision 4504 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/VectorialDefaultAdapter.java

View differences:

VectorialDefaultAdapter.java
58 58
 *
59 59
 */
60 60
public class VectorialDefaultAdapter extends VectorialAdapter {
61

  
61
	private SelectableDataSource ds;
62 62
    /* (non-Javadoc)
63 63
     * @see com.iver.cit.gvsig.fmap.layers.VectorialAdapter#getRecordset()
64 64
     */
65 65
    public SelectableDataSource getRecordset() throws DriverLoadException {
66 66
        if (getDriver() instanceof ObjectDriver)
67 67
        {
68
            String name = LayerFactory.getDataSourceFactory().addDataSource((ObjectDriver)getDriver());
69
            try {
70
                SelectableDataSource ds = new SelectableDataSource(LayerFactory.getDataSourceFactory().createRandomDataSource(name, DataSourceFactory.AUTOMATIC_OPENING));
71
                return ds;
72
            } catch (NoSuchTableException e) {
73
                throw new RuntimeException(e);
74
            } catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
75
                throw new RuntimeException(e);
76
            }
68
        	if (ds == null) {
69
        		String name = LayerFactory.getDataSourceFactory().addDataSource((ObjectDriver)getDriver());
70
        		try {
71
        			ds = new SelectableDataSource(LayerFactory.getDataSourceFactory().createRandomDataSource(name, DataSourceFactory.AUTOMATIC_OPENING));
72
        		} catch (NoSuchTableException e) {
73
        			throw new RuntimeException(e);
74
        		} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) {
75
        			throw new RuntimeException(e);
76
        		}
77
        	}
78
        	else
79
        		return ds;
77 80
        }
78 81
        return null;
79 82

  

Also available in: Unified diff