|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
CommitDbCommand.java | - | 0% | 0% | 0% |
|
1 |
/*
|
|
2 |
* Created on 25/Jan/2004
|
|
3 |
*
|
|
4 |
* To change the template for this generated file go to
|
|
5 |
* Window>Preferences>Java>Code Generation>Code and Comments
|
|
6 |
*/
|
|
7 |
package replica.database.commands;
|
|
8 |
|
|
9 |
import java.sql.SQLException;
|
|
10 |
import java.util.logging.Level;
|
|
11 |
|
|
12 |
import replica.server.commands.PrintCommand;
|
|
13 |
|
|
14 |
/**
|
|
15 |
* @author Pedro
|
|
16 |
*
|
|
17 |
* To change the template for this generated type comment go to
|
|
18 |
* Window>Preferences>Java>Code Generation>Code and Comments
|
|
19 |
*/
|
|
20 |
public class CommitDbCommand extends DatabaseCommand { |
|
21 |
|
|
22 |
/**
|
|
23 |
*
|
|
24 |
*/
|
|
25 | 0 |
public CommitDbCommand() {
|
26 | 0 |
super();
|
27 |
} |
|
28 |
|
|
29 |
/* (non-Javadoc)
|
|
30 |
* @see replica.database.commands.DatabaseCommand#execute(replica.database.commands.DatabaseCommandVO)
|
|
31 |
*/
|
|
32 | 0 |
protected Object execute(DatabaseCommandVO c) {
|
33 |
|
|
34 | 0 |
try{
|
35 | 0 |
c.getConnection().commit(); |
36 |
|
|
37 | 0 |
return PrintCommand.NAME + " Commited."; |
38 |
} |
|
39 |
catch(SQLException e){
|
|
40 |
|
|
41 | 0 |
logger.log(Level.SEVERE, e.getMessage(), e); |
42 |
|
|
43 | 0 |
return PrintCommand.NAME + " Error on commit:[" + e.getMessage() + "]."; |
44 |
} |
|
45 |
} |
|
46 |
|
|
47 |
} |
|
48 |
|
|