Statistics
| Revision:

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 @ 44191

History | View | Annotate | Download (3.09 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
    @Override
51
    public int hasTabularSupport() {
52
        return YES;
53
    }    
54

    
55
    @Override
56
    public int hasSQLSupport() {
57
        return YES;
58
    }
59
    
60
    protected JDBCStoreProviderFactory(String name, String description) {
61
        super(name, description);
62
    }
63
    
64
    protected JDBCStoreProviderFactory(String name, String description, boolean hidden) {
65
        super(name, description, hidden);
66
    }
67

    
68
    @Override
69
    public JDBCStoreProvider createProvider(
70
            DataParameters parameters,
71
            DataStoreProviderServices providerServices
72
    ) throws InitializeException {
73
        JDBCHelper helper = new JDBCHelperBase((JDBCConnectionParameters) parameters);
74
        JDBCStoreProvider provider = helper.createProvider(
75
                (JDBCStoreParameters) parameters, 
76
                providerServices
77
        );
78
        return provider;
79
    }
80
    
81
    @Override
82
    public JDBCStoreParameters createParameters() {
83
        JDBCStoreParameters params = new JDBCStoreParameters(
84
                NAME + "StoreParameters",
85
                NAME 
86
        );
87
        return params;
88
    }
89

    
90
    @Override
91
    public int isOptimalRecoverFeaturesByReference() {
92
        return NO;
93
    }
94

    
95
    public int useLocalIndexesCanImprovePerformance() {
96
        return NO;
97
    }
98
    
99
}