Revision 33286 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/ConnectionJDBC.java
ConnectionJDBC.java | ||
---|---|---|
58 | 58 |
private String user; |
59 | 59 |
private String _pw; |
60 | 60 |
|
61 |
// to cache the quote string to avoid make a query each time |
|
62 |
private String identifierQuoteString = null; |
|
63 |
|
|
61 | 64 |
public ConnectionJDBC() { |
62 | 65 |
|
63 | 66 |
} |
... | ... | |
134 | 137 |
|
135 | 138 |
} |
136 | 139 |
|
140 |
/** |
|
141 |
* |
|
142 |
* @return the quote string for this gbdms. A empty string is returned if there are any error |
|
143 |
* or if quoting is not supported |
|
144 |
*/ |
|
145 |
public String getIdentifierQuoteString() { |
|
146 |
/* if there is not an error the quote string is cached, if there is an error an empty string |
|
147 |
* is returned to avoid obligate the user to check this method. |
|
148 |
*/ |
|
149 |
|
|
150 |
String quote = identifierQuoteString; |
|
151 |
if (quote == null) { |
|
152 |
try { |
|
153 |
quote = connection.getMetaData().getIdentifierQuoteString().trim(); |
|
154 |
identifierQuoteString = quote; |
|
155 |
|
|
156 |
} catch (SQLException e) { |
|
157 |
quote = ""; |
|
158 |
} |
|
159 |
} |
|
160 |
return quote; |
|
161 |
} |
|
162 |
|
|
137 | 163 |
public String getTypeConnection() { |
138 | 164 |
return "jdbc"; |
139 | 165 |
} |
Also available in: Unified diff