|
|||||||||||||||||||
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 | |||||||||||||||
StatementDbCommand.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.sql.Statement;
|
|
11 |
import java.util.logging.Level;
|
|
12 |
|
|
13 |
import replica.server.commands.PrintCommand;
|
|
14 |
|
|
15 |
/**
|
|
16 |
* @author Pedro
|
|
17 |
*
|
|
18 |
* To change the template for this generated type comment go to
|
|
19 |
* Window>Preferences>Java>Code Generation>Code and Comments
|
|
20 |
*/
|
|
21 |
public abstract class StatementDbCommand extends DatabaseCommand { |
|
22 |
|
|
23 | 0 |
public Object execute(DatabaseCommandVO arg) {
|
24 |
|
|
25 | 0 |
logger.info("Received command : " + arg);
|
26 |
|
|
27 | 0 |
Statement st = null;
|
28 | 0 |
try{
|
29 | 0 |
st = arg.getConnection().createStatement(); |
30 | 0 |
return execute( st, arg.getCommand() );
|
31 |
} |
|
32 |
catch(SQLException e){
|
|
33 | 0 |
getLogger().log(Level.WARNING, e.getMessage(), e); |
34 | 0 |
return PrintCommand.NAME + " " + e.getMessage(); |
35 |
} |
|
36 |
} |
|
37 |
|
|
38 |
abstract protected Object execute(Statement st, String command) throws SQLException; |
|
39 |
} |
|
40 |
|
|