Revision 29932 branches/v2_0_0_prep/extensions/org.gvsig.oracle/src/org/gvsig/fmap/dal/store/oracle/OracleServerExplorerParameters.java
OracleServerExplorerParameters.java | ||
---|---|---|
1 | 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 |
*/ |
|
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 | 22 |
|
23 | 23 |
/* |
24 | 24 |
* AUTHORS (In addition to CIT): |
... | ... | |
39 | 39 |
|
40 | 40 |
/** |
41 | 41 |
* @author vsanjaime |
42 |
* |
|
42 |
*
|
|
43 | 43 |
*/ |
44 | 44 |
public class OracleServerExplorerParameters extends |
45 | 45 |
JDBCServerExplorerParameters implements OracleConnectionParameters { |
46 | 46 |
|
47 |
public static final String DYNCLASS_NAME = "OracleServerExplorerParameters"; |
|
47 | 48 |
|
48 |
public static final String DYNCLASS_NAME = "OracleSpatialServerExplorerParameters"; |
|
49 |
|
|
50 | 49 |
protected DynClass registerDynClass() { |
51 | 50 |
DynObjectManager dynman = ToolsLocator.getDynObjectManager(); |
52 | 51 |
DynClass dynClass = dynman.get(DYNCLASS_NAME); |
... | ... | |
63 | 62 |
return dynClass; |
64 | 63 |
} |
65 | 64 |
|
66 |
/* (non-Javadoc) |
|
65 |
/* |
|
66 |
* (non-Javadoc) |
|
67 |
* |
|
67 | 68 |
* @see org.gvsig.fmap.dal.DataServerExplorerParameters#getExplorerName() |
68 | 69 |
*/ |
69 | 70 |
public String getExplorerName() { |
... | ... | |
74 | 75 |
return (Boolean) this.getDynValue(DYNFIELDNAME_USESSL); |
75 | 76 |
} |
76 | 77 |
|
78 |
public String getOraDriverType() { |
|
79 |
return (String) this.getDynValue(DYNFIELDNAME_ORADRIVERTYPE); |
|
80 |
} |
|
81 |
|
|
77 | 82 |
public void setUseSSL(Boolean useSSL) { |
78 | 83 |
this.setDynValue(DYNFIELDNAME_USESSL, useSSL); |
79 | 84 |
} |
... | ... | |
82 | 87 |
this.setDynValue(DYNFIELDNAME_USESSL, new Boolean(useSSL)); |
83 | 88 |
} |
84 | 89 |
|
90 |
public void setOraDriverType(String oraDriverType) { |
|
91 |
this.setDynValue(DYNFIELDNAME_ORADRIVERTYPE, oraDriverType); |
|
92 |
} |
|
93 |
|
|
85 | 94 |
public void validate() throws ValidateDataParametersException { |
86 | 95 |
if (getJDBCDriverClassName() == null) { |
87 | 96 |
setJDBCDriverClassName(OracleLibrary.DEFAULT_JDCB_DRIVER_NAME); |
88 | 97 |
} |
89 | 98 |
if (getUrl() == null) { |
90 |
setUrl(OracleLibrary.getJdbcUrl(getHost(), getPort(),
|
|
91 |
getDBName())); |
|
99 |
setUrl(OracleLibrary.getJdbcUrl(getOraDriverType(), getHost(),
|
|
100 |
getPort(), getDBName()));
|
|
92 | 101 |
} |
93 | 102 |
|
94 | 103 |
if (getPort() == null) { |
95 | 104 |
setPort(new Integer(1521)); |
96 | 105 |
} |
106 |
|
|
107 |
if (getOraDriverType().compareToIgnoreCase("THIN") != 0 |
|
108 |
&& getOraDriverType().compareToIgnoreCase("OCI") != 0) { |
|
109 |
setOraDriverType("thin"); |
|
110 |
} |
|
111 |
|
|
97 | 112 |
super.validate(); |
98 | 113 |
} |
99 | 114 |
|
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 | 115 |
} |
Also available in: Unified diff