svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.db / org.gvsig.fmap.dal.db.h2 / src / main / java / org / gvsig / fmap / dal / store / h2 / H2SpatialStoreParameters.java @ 44399
History | View | Annotate | Download (2.29 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
package org.gvsig.fmap.dal.store.h2; |
23 |
|
24 |
import java.io.File; |
25 |
import java.util.Properties; |
26 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
27 |
import org.gvsig.fmap.dal.store.jdbc.JDBCConnectionParameters; |
28 |
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters; |
29 |
|
30 |
public class H2SpatialStoreParameters extends JDBCStoreParameters implements H2SpatialConnectionParameters { |
31 |
|
32 |
private final H2SpatialConnectionParametersHelper helper; |
33 |
|
34 |
public H2SpatialStoreParameters() {
|
35 |
super(
|
36 |
H2SpatialLibrary.NAME + "StoreParameters",
|
37 |
H2SpatialLibrary.NAME |
38 |
); |
39 |
this.helper = new H2SpatialConnectionParametersHelper(this); |
40 |
} |
41 |
|
42 |
@Override
|
43 |
public String getUrl() { |
44 |
return this.helper.getUrl(); |
45 |
} |
46 |
|
47 |
@Override
|
48 |
public void validate() throws ValidateDataParametersException { |
49 |
this.helper.validate();
|
50 |
super.validate();
|
51 |
} |
52 |
|
53 |
@Override
|
54 |
public Properties getProperties() { |
55 |
return this.helper.getProperties(); |
56 |
} |
57 |
|
58 |
@Override
|
59 |
public File getFile() { |
60 |
return this.helper.getFile(); |
61 |
} |
62 |
|
63 |
@Override
|
64 |
public void setFile(File database) { |
65 |
try {
|
66 |
this.helper.setFile(database);
|
67 |
String url = H2SpatialHelper.getConnectionURL((H2SpatialConnectionParameters) this); |
68 |
this.setDynValue(JDBCConnectionParameters.URL_PARAMTER_NAME, url);
|
69 |
} catch (Exception ex) { |
70 |
} |
71 |
} |
72 |
|
73 |
} |