Revision 27723 branches/v2_0_0_prep/extensions/extGeoDB/src/com/iver/cit/gvsig/vectorialdb/DBResourceManager.java
DBResourceManager.java | ||
---|---|---|
31 | 31 |
package com.iver.cit.gvsig.vectorialdb; |
32 | 32 |
|
33 | 33 |
import org.gvsig.fmap.dal.DALLocator; |
34 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
35 | 34 |
import org.gvsig.fmap.dal.resource.Resource; |
36 | 35 |
import org.gvsig.fmap.dal.resource.ResourceManager; |
37 | 36 |
import org.gvsig.fmap.dal.resource.ResourceNotification; |
37 |
import org.gvsig.fmap.dal.resource.db.DBParameters; |
|
38 |
import org.gvsig.fmap.dal.store.jdbc.JDBCResource; |
|
39 |
import org.gvsig.fmap.dal.store.jdbc.JDBCResourceParameters; |
|
40 |
import org.gvsig.fmap.data.feature.db.DBExplorerParameters; |
|
38 | 41 |
import org.gvsig.tools.observer.Observable; |
39 | 42 |
import org.gvsig.tools.observer.Observer; |
40 | 43 |
|
... | ... | |
59 | 62 |
return; |
60 | 63 |
} |
61 | 64 |
JDBCResource res = (JDBCResource)resNot.getResource(); |
62 |
if (!checking && res.getPassword()== null){ |
|
65 |
JDBCResourceParameters resPrams = (JDBCResourceParameters) resNot |
|
66 |
.getParameters(); |
|
67 |
if (!checking && resPrams.getPassword() == null) { |
|
63 | 68 |
checking = true; |
64 | 69 |
JPasswordDlg passwordPanel=new JPasswordDlg(); |
65 | 70 |
passwordPanel.setMessage(PluginServices.getText(this,"falta_por_introducir_la_clave_en_la_conexion")); |
66 | 71 |
PluginServices.getMDIManager().addCentredWindow(passwordPanel); |
67 |
try { |
|
68 |
res.setPassword(passwordPanel.getPassword()); |
|
69 |
} catch (InitializeException e) { |
|
70 |
throw new RuntimeException(e); |
|
71 |
} |
|
72 |
if(!res.testConnection()){ |
|
73 |
checking=false; |
|
74 |
try { |
|
75 |
res.setPassword(null); |
|
76 |
} catch (InitializeException e) { |
|
77 |
e.printStackTrace(); |
|
78 |
} |
|
79 |
} |
|
80 |
checking=false; |
|
72 |
resPrams.setPassword(passwordPanel.getPassword()); |
|
73 |
// TODO check if password is ok ?? |
|
74 |
// if(!res.testConnection()){ |
|
75 |
// checking=false; |
|
76 |
// try { |
|
77 |
// res.setPassword(null); |
|
78 |
// } catch (InitializeException e) { |
|
79 |
// e.printStackTrace(); |
|
80 |
// } |
|
81 |
// } |
|
82 |
// checking=false; |
|
81 | 83 |
} |
82 | 84 |
} |
83 | 85 |
|
Also available in: Unified diff