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.jdbc / src / main / java / org / gvsig / fmap / dal / store / jdbc2 / impl / JDBCStoreProviderFactory.java @ 43020
History | View | Annotate | Download (2.62 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or modify it under
|
7 |
* the terms of the GNU General Public License as published by the Free Software
|
8 |
* Foundation; either version 3 of the License, or (at your option) any later
|
9 |
* version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful, but WITHOUT
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
14 |
* details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License along with
|
17 |
* this program; if not, write to the Free Software Foundation, Inc., 51
|
18 |
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
19 |
*
|
20 |
* For any additional information, do not hesitate to contact us at info AT
|
21 |
* gvsig.com, or visit our website www.gvsig.com.
|
22 |
*/
|
23 |
package org.gvsig.fmap.dal.store.jdbc2.impl; |
24 |
|
25 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCLibrary; |
26 |
|
27 |
import org.gvsig.fmap.dal.DataParameters; |
28 |
import org.gvsig.fmap.dal.exception.InitializeException; |
29 |
import org.gvsig.fmap.dal.feature.spi.AbstractFeatureStoreProviderFactory; |
30 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
31 |
import org.gvsig.fmap.dal.store.jdbc.JDBCConnectionParameters; |
32 |
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters; |
33 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper; |
34 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCStoreProvider; |
35 |
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCHelperBase; |
36 |
|
37 |
public class JDBCStoreProviderFactory |
38 |
extends AbstractFeatureStoreProviderFactory
|
39 |
{ |
40 |
|
41 |
private static final String NAME = JDBCLibrary.NAME; |
42 |
|
43 |
public JDBCStoreProviderFactory() {
|
44 |
this(
|
45 |
NAME, |
46 |
"JDBC generic store (2)"
|
47 |
); |
48 |
} |
49 |
|
50 |
protected JDBCStoreProviderFactory(String name, String description) { |
51 |
super(name, description);
|
52 |
} |
53 |
|
54 |
@Override
|
55 |
public JDBCStoreProvider createProvider(
|
56 |
DataParameters parameters, |
57 |
DataStoreProviderServices providerServices |
58 |
) throws InitializeException {
|
59 |
JDBCHelper helper = new JDBCHelperBase((JDBCConnectionParameters) parameters);
|
60 |
JDBCStoreProvider provider = helper.createProvider( |
61 |
(JDBCStoreParameters) parameters, |
62 |
providerServices |
63 |
); |
64 |
return provider;
|
65 |
} |
66 |
|
67 |
@Override
|
68 |
public JDBCStoreParameters createParameters() {
|
69 |
JDBCStoreParameters params = new JDBCStoreParameters(
|
70 |
NAME + "StoreParameters",
|
71 |
NAME |
72 |
); |
73 |
return params;
|
74 |
} |
75 |
|
76 |
} |