Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_daldb / src / org / gvsig / fmap / data / feature / db / jdbc / JDBCExplorer.java @ 24491

History | View | Annotate | Download (1.19 KB)

1
package org.gvsig.fmap.data.feature.db.jdbc;
2

    
3
import java.sql.Connection;
4

    
5
import org.gvsig.fmap.dal.DataExplorerParameters;
6
import org.gvsig.fmap.dal.DataManager;
7
import org.gvsig.fmap.dal.DataStore;
8
import org.gvsig.fmap.dal.DataStoreParameters;
9
import org.gvsig.fmap.dal.exceptions.InitializeException;
10
import org.gvsig.fmap.dal.exceptions.ReadException;
11
import org.gvsig.fmap.dal.feature.exceptions.InitializeWriterException;
12
import org.gvsig.fmap.dal.impl.DefaultDataManager;
13
import org.gvsig.fmap.data.feature.db.DBExplorer;
14

    
15
public abstract class JDBCExplorer extends DBExplorer {
16

    
17
        protected JDBCResource resource;
18

    
19

    
20
        /* (non-Javadoc)
21
         * @see org.gvsig.fmap.dal.DataExplorer#init(org.gvsig.fmap.dal.DataExplorerParameters)
22
         */
23
        public void init(DataExplorerParameters parameters,JDBCResource resource) throws InitializeException {
24
                super.init(parameters);
25
                this.resource = resource;
26
        }
27

    
28
        protected Connection getConnection() throws ReadException{
29
                return this.resource.getConnection();
30
        }
31

    
32
        public DataStore createDataStore(DataStoreParameters dsp) throws InitializeException, InitializeWriterException {
33
                DataManager manager = DefaultDataManager.getManager();
34
                return manager.createStore(dsp);
35
        }
36

    
37

    
38
}