Revision 10626 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/table/ProjectTableFactory.java
ProjectTableFactory.java | ||
---|---|---|
9 | 9 |
import javax.swing.JPanel; |
10 | 10 |
|
11 | 11 |
import com.hardcode.driverManager.DriverLoadException; |
12 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
12 | 13 |
import com.hardcode.gdbms.engine.data.DataSource; |
13 | 14 |
import com.hardcode.gdbms.engine.data.DataSourceFactory; |
14 | 15 |
import com.hardcode.gdbms.engine.data.NoSuchTableException; |
15 | 16 |
import com.hardcode.gdbms.engine.data.driver.DBDriver; |
16 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
|
17 | 17 |
import com.hardcode.gdbms.engine.data.driver.FileDriver; |
18 | 18 |
import com.iver.andami.PluginServices; |
19 | 19 |
import com.iver.andami.messages.NotificationManager; |
... | ... | |
143 | 143 |
user = null; |
144 | 144 |
password = null; |
145 | 145 |
} |
146 |
|
|
147 |
name = name + " Table:" + dbod.getTable(); |
|
148 | 146 |
|
147 |
name = name + " Table:" + dbod.getTable(); |
|
148 |
|
|
149 | 149 |
LayerFactory.getDataSourceFactory().addDBDataSourceByTable(name, |
150 | 150 |
dbod.getHost(), port, user, password, |
151 | 151 |
dbod.getDataBase(), dbod.getTable(), driverName); |
... | ... | |
180 | 180 |
} |
181 | 181 |
} catch (DriverLoadException e) { |
182 | 182 |
NotificationManager.addError("Error al cargar los drivers", e); |
183 |
} catch (com.hardcode.gdbms.engine.data.driver.DriverException e) { |
|
184 |
e.printStackTrace(); |
|
185 | 183 |
} catch (NoSuchTableException e) { |
186 | 184 |
e.printStackTrace(); |
187 |
} |
|
185 |
} catch (ReadDriverException e) { |
|
186 |
e.printStackTrace(); |
|
187 |
} |
|
188 | 188 |
|
189 | 189 |
return null; |
190 | 190 |
} |
... | ... | |
196 | 196 |
* |
197 | 197 |
* @return ProjectTable. |
198 | 198 |
*/ |
199 |
public static ProjectTable createTable(String name, IEditableSource es) |
|
200 |
throws com.hardcode.gdbms.engine.data.driver.DriverException { |
|
199 |
public static ProjectTable createTable(String name, IEditableSource es) { |
|
201 | 200 |
ProjectTable t = new ProjectTable(); |
202 | 201 |
|
203 | 202 |
if (es != null) { |
... | ... | |
207 | 206 |
t.createAlias(); |
208 | 207 |
} catch (DriverLoadException e) { |
209 | 208 |
e.printStackTrace(); |
210 |
} |
|
209 |
} catch (ReadDriverException e) { |
|
210 |
e.printStackTrace(); |
|
211 |
} |
|
211 | 212 |
} |
212 | 213 |
|
213 | 214 |
t.setName(name); |
... | ... | |
260 | 261 |
public ProjectDocument create(Project project) { |
261 | 262 |
ProjectTable pt = null; |
262 | 263 |
|
263 |
try { |
|
264 |
pt = ProjectTableFactory.createTable("", null); |
|
265 |
} catch (DriverException e) { |
|
266 |
e.printStackTrace(); |
|
267 |
} |
|
264 |
pt = ProjectTableFactory.createTable("", null); |
|
268 | 265 |
pt.setProject(project,0); |
269 | 266 |
|
270 | 267 |
pt.setProjectDocumentFactory(this); |
Also available in: Unified diff