/[projects]/miscJava/CircuitBreaker/src/main/java/dk/thoerup/circuitbreaker/invocations/SQLUpdateInvocation.java
ViewVC logotype

Annotation of /miscJava/CircuitBreaker/src/main/java/dk/thoerup/circuitbreaker/invocations/SQLUpdateInvocation.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2448 - (hide annotations) (download)
Fri Mar 20 08:52:49 2015 UTC (9 years, 3 months ago) by torben
Original Path: miscJava/CircuitBreaker/src/dk/thoerup/circuitbreaker/invocations/SQLUpdateInvocation.java
File size: 757 byte(s)
move java components to java folder
1 torben 472 package dk.thoerup.circuitbreaker.invocations;
2    
3     import java.sql.PreparedStatement;
4     import java.sql.Statement;
5    
6     import dk.thoerup.circuitbreaker.CircuitInvocation;
7    
8     public class SQLUpdateInvocation implements CircuitInvocation {
9    
10     PreparedStatement pStatement = null;
11     Statement statement = null;
12     String sql = null;
13    
14    
15     public SQLUpdateInvocation(Statement stmt, String sql) {
16     this.statement = stmt;
17     this.sql = sql;
18     }
19    
20     public SQLUpdateInvocation(PreparedStatement pstmt) {
21     pStatement = pstmt;
22     }
23    
24    
25     public Integer proceed() throws Exception {
26     int rows;
27    
28     if (pStatement != null) {
29     rows = pStatement.executeUpdate();
30     } else {
31     rows = statement.executeUpdate(sql);
32     }
33    
34     return rows;
35     }
36    
37    
38     }

  ViewVC Help
Powered by ViewVC 1.1.20