svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_dataDB / src / org / gvsig / data / datastores / vectorial / db / jdbc / JDBCExplorer.java @ 20973
History | View | Annotate | Download (1.18 KB)
1 |
package org.gvsig.data.datastores.vectorial.db.jdbc; |
---|---|
2 |
|
3 |
import java.sql.Connection; |
4 |
|
5 |
import org.gvsig.data.DataManager; |
6 |
import org.gvsig.data.IDataExplorerParameters; |
7 |
import org.gvsig.data.IDataStore; |
8 |
import org.gvsig.data.IDataStoreParameters; |
9 |
import org.gvsig.data.InitializeException; |
10 |
import org.gvsig.data.ReadException; |
11 |
import org.gvsig.data.datastores.vectorial.InitializeWriterException; |
12 |
import org.gvsig.data.datastores.vectorial.db.DBExplorer; |
13 |
|
14 |
public abstract class JDBCExplorer extends DBExplorer { |
15 |
|
16 |
protected JDBCResource resource;
|
17 |
protected JDBCExplorerParameter parameters;
|
18 |
|
19 |
|
20 |
/* (non-Javadoc)
|
21 |
* @see org.gvsig.data.IDataExplorer#init(org.gvsig.data.IDataExplorerParameters)
|
22 |
*/
|
23 |
public void init(IDataExplorerParameters parameters,JDBCResource resource) throws InitializeException { |
24 |
this.parameters = (JDBCExplorerParameter)parameters;
|
25 |
this.resource = resource;
|
26 |
} |
27 |
|
28 |
protected Connection getConnection() throws ReadException{ |
29 |
return this.resource.getConnection(); |
30 |
} |
31 |
|
32 |
public IDataStore createDataStore(IDataStoreParameters dsp) throws InitializeException, InitializeWriterException { |
33 |
DataManager manager = DataManager.getManager(); |
34 |
return manager.createDataStore(dsp);
|
35 |
} |
36 |
|
37 |
|
38 |
} |