Revision 19610 trunk/libraries/libDataSourceDBBaseDrivers/src/org/gvsig/data/datastores/vectorial/driver/jdbc/ConnectionFactory.java
ConnectionFactory.java | ||
---|---|---|
73 | 73 |
String user, String _pw) { |
74 | 74 |
IConnection connection = null; |
75 | 75 |
|
76 |
if (connectionStr.startsWith("jdbc")) { |
|
77 |
connection = new ConnectionJDBC(); |
|
78 |
connection.setDataConnection(connectionStr, user, _pw); |
|
79 |
return connection; |
|
80 |
} else { |
|
81 |
// if (lastConnections.containsKey(connectionStr)) |
|
82 |
// return (IConnection)lastConnections.get(connectionStr); |
|
76 |
// if (connectionStr.startsWith("jdbc")) { |
|
77 |
// connection = new ConnectionJDBC(); |
|
78 |
// connection.setDataConnection(connectionStr, user, _pw); |
|
79 |
// return connection; |
|
80 |
// } else { |
|
81 |
//// if (lastConnections.containsKey(connectionStr)) |
|
82 |
//// return (IConnection)lastConnections.get(connectionStr); |
|
83 |
// |
|
84 |
// refreshExtensionPointsConnections(); |
|
85 |
// |
|
86 |
// IConnection[] conns = (IConnection[]) connections.toArray(new IConnection[0]); |
|
87 |
// String type = connectionStr.substring(0,connectionStr.indexOf(":")); |
|
88 |
// |
|
89 |
// for (int i = 0; i < conns.length; i++) { |
|
90 |
// if (conns[i].getTypeConnection().equals(type)) { |
|
91 |
// connection=conns[i]; |
|
92 |
// connection.setDataConnection(connectionStr, user, _pw); |
|
93 |
//// lastConnections.put(connectionStr,connection); |
|
94 |
// return connection; |
|
95 |
// } |
|
96 |
// } |
|
97 |
// } |
|
83 | 98 |
|
84 |
refreshExtensionPointsConnections(); |
|
85 |
|
|
86 |
IConnection[] conns = (IConnection[]) connections.toArray(new IConnection[0]); |
|
87 |
String type = connectionStr.substring(0,connectionStr.indexOf(":")); |
|
88 |
|
|
89 |
for (int i = 0; i < conns.length; i++) { |
|
90 |
if (conns[i].getTypeConnection().equals(type)) { |
|
91 |
connection=conns[i]; |
|
92 |
connection.setDataConnection(connectionStr, user, _pw); |
|
93 |
// lastConnections.put(connectionStr,connection); |
|
94 |
return connection; |
|
95 |
} |
|
96 |
} |
|
97 |
} |
|
98 |
|
|
99 | 99 |
return connection; |
100 | 100 |
} |
101 | 101 |
|
Also available in: Unified diff