PreparedStatementstatement=connection.prepareStatement("update transactions set startingTime=?,finishingTime=?,transactionType=?,username=? where transactionId=?;");
PreparedStatementstatement=connection.prepareStatement("update sessions set startingTime=?, finishingTime=?,username=?,sshHostname=?,sshPort=?,sessionStatus=? where sessionId=?;");
logger.info("Requesting incomplete transaction from a specific user");
Connectionconnection=dataSource.getConnection();
PreparedStatementstatement=connection.prepareStatement("select t.* from transactions t where exists(select null from files f where f.transactionId = t.transactionId and f.fileStatus=? and t.username=?);");
statement.setInt(1,FileStatus.STARTED.toInt());
...
...
@@ -207,6 +217,7 @@ public class DBConnectionImpl implements DBConnection {
logger.info("Requesting transactions which were executed during a given ssh session");
Connectionconnection=dataSource.getConnection();
PreparedStatementstatement=connection.prepareStatement("select t.* from transactions as t inner join transactionsWithSessions as ts on t.transactionId = ts.transactionId where ts.sessionId = ?;");
statement.setInt(1,session.getSessionId());
...
...
@@ -222,6 +233,7 @@ public class DBConnectionImpl implements DBConnection {
logger.info("Requesting sessions during which a given transaction was executed");
Connectionconnection=dataSource.getConnection();
PreparedStatementstatement=connection.prepareStatement("select s.* from sessions as s inner join transactionsWithSessions as ts on s.sessionId = ts.sessionId where ts.transactionId = ?;");