|
|
@ -26,9 +26,9 @@ public class OperationDAOImpl implements OperationDAO {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean addOperation(Operation operation)
|
|
|
|
public int addOperation(Operation operation)
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
throws MobileDeviceManagementDAOException {
|
|
|
|
boolean status = false;
|
|
|
|
int status = -1;
|
|
|
|
Connection conn = null;
|
|
|
|
Connection conn = null;
|
|
|
|
PreparedStatement stmt = null;
|
|
|
|
PreparedStatement stmt = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -36,12 +36,15 @@ public class OperationDAOImpl implements OperationDAO {
|
|
|
|
String createDBQuery =
|
|
|
|
String createDBQuery =
|
|
|
|
"INSERT INTO MBL_OPERATION(FEATURE_CODE, CREATED_DATE) VALUES ( ?, ?)";
|
|
|
|
"INSERT INTO MBL_OPERATION(FEATURE_CODE, CREATED_DATE) VALUES ( ?, ?)";
|
|
|
|
|
|
|
|
|
|
|
|
stmt = conn.prepareStatement(createDBQuery);
|
|
|
|
stmt = conn.prepareStatement(createDBQuery, new String[] { "OPERATION_ID" });
|
|
|
|
stmt.setString(1, operation.getFeatureCode());
|
|
|
|
stmt.setString(1, operation.getFeatureCode());
|
|
|
|
stmt.setInt(2, operation.getCreatedDate());
|
|
|
|
stmt.setInt(2, operation.getCreatedDate());
|
|
|
|
int rows = stmt.executeUpdate();
|
|
|
|
int rows = stmt.executeUpdate();
|
|
|
|
if (rows > 0) {
|
|
|
|
if (rows > 0) {
|
|
|
|
status = true;
|
|
|
|
ResultSet rs = stmt.getGeneratedKeys();
|
|
|
|
|
|
|
|
if (rs != null && rs.next()) {
|
|
|
|
|
|
|
|
status = rs.getInt(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (SQLException e) {
|
|
|
|
} catch (SQLException e) {
|
|
|
|
String msg = "Error occurred while adding feature code - '" +
|
|
|
|
String msg = "Error occurred while adding feature code - '" +
|
|
|
|