Revision 46315 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.db/org.gvsig.fmap.dal.db.jdbc/src/main/java/org/gvsig/fmap/dal/store/jdbc2/spi/operations/PerformChangesOperation.java
PerformChangesOperation.java | ||
---|---|---|
23 | 23 |
*/ |
24 | 24 |
package org.gvsig.fmap.dal.store.jdbc2.spi.operations; |
25 | 25 |
|
26 |
import java.sql.Connection; |
|
27 | 26 |
import java.sql.PreparedStatement; |
28 | 27 |
import java.sql.SQLException; |
29 | 28 |
import java.sql.Statement; |
... | ... | |
47 | 46 |
import org.gvsig.fmap.dal.feature.spi.FeatureReferenceProviderServices; |
48 | 47 |
import org.gvsig.fmap.dal.store.jdbc.exception.JDBCExecuteSQLException; |
49 | 48 |
import org.gvsig.fmap.dal.store.jdbc.exception.JDBCSQLException; |
49 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCConnection; |
|
50 | 50 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCHelper; |
51 | 51 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCUtils; |
52 | 52 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory.TableReference; |
... | ... | |
104 | 104 |
} |
105 | 105 |
|
106 | 106 |
@Override |
107 |
public Object perform(Connection conn) throws DataException { |
|
107 |
public Object perform(JDBCConnection conn) throws DataException {
|
|
108 | 108 |
if (typeChanged) { |
109 | 109 |
this.performUpdateTable(conn); |
110 | 110 |
} |
... | ... | |
153 | 153 |
return sql; |
154 | 154 |
} |
155 | 155 |
|
156 |
public void performDeletes(Connection conn) throws DataException { |
|
156 |
public void performDeletes(JDBCConnection conn) throws DataException {
|
|
157 | 157 |
JDBCSQLBuilderBase sqlbuilder = createSQLBuilder(); |
158 | 158 |
String sql = getDeleteSQL(sqlbuilder); |
159 | 159 |
perform_batchmode(conn, this.deleteds, sqlbuilder, sql, new Invocable() { |
... | ... | |
213 | 213 |
return sql; |
214 | 214 |
} |
215 | 215 |
|
216 |
public void performInserts(Connection conn) throws DataException { |
|
216 |
public void performInserts(JDBCConnection conn) throws DataException {
|
|
217 | 217 |
JDBCSQLBuilderBase sqlbuilder = createSQLBuilder(); |
218 | 218 |
String sql = getInsertSQL(sqlbuilder); |
219 | 219 |
perform_batchmode(conn, this.inserteds, sqlbuilder, sql, new Invocable() { |
... | ... | |
286 | 286 |
return sql; |
287 | 287 |
} |
288 | 288 |
|
289 |
public void performUpdates(Connection conn) throws DataException { |
|
289 |
public void performUpdates(JDBCConnection conn) throws DataException {
|
|
290 | 290 |
JDBCSQLBuilderBase sqlbuilder = createSQLBuilder(); |
291 | 291 |
String sql = getUpdateSQL(sqlbuilder); |
292 | 292 |
perform_batchmode(conn, this.updateds, sqlbuilder, sql, new Invocable() { |
... | ... | |
302 | 302 |
} |
303 | 303 |
|
304 | 304 |
|
305 |
private void perform_batchmode(Connection conn, Iterator elements, JDBCSQLBuilderBase sqlbuilder, String sql, Invocable fillPreparedStatement) throws DataException { |
|
305 |
private void perform_batchmode(JDBCConnection conn, Iterator elements, JDBCSQLBuilderBase sqlbuilder, String sql, Invocable fillPreparedStatement) throws DataException {
|
|
306 | 306 |
PreparedStatement preparedStatement; |
307 | 307 |
Disposable[] disposableParameters; |
308 | 308 |
try { |
... | ... | |
542 | 542 |
return sqls; |
543 | 543 |
} |
544 | 544 |
|
545 |
public void performUpdateTable(Connection conn) throws DataException { |
|
545 |
public void performUpdateTable(JDBCConnection conn) throws DataException {
|
|
546 | 546 |
|
547 | 547 |
List<String> sqls = this.getUpdateTableSQLs(); |
548 | 548 |
|
Also available in: Unified diff