Add return generated keys flag

feature/appm-store/pbac
inoshperera 5 years ago
parent 0539971f40
commit f3d34a0ad6

@ -26,6 +26,7 @@ import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
@ -175,7 +176,7 @@ public class SQLServerSubscriptionDAOImpl extends GenericSubscriptionDAOImpl {
+ "VALUES (?, ?, ?, ?, ?, ?, ?)"; + "VALUES (?, ?, ?, ?, ?, ?, ?)";
try { try {
Connection conn = this.getDBConnection(); Connection conn = this.getDBConnection();
try (PreparedStatement stmt = conn.prepareStatement(sql)) { try (PreparedStatement stmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS)) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
Timestamp timestamp = new Timestamp(calendar.getTime().getTime()); Timestamp timestamp = new Timestamp(calendar.getTime().getTime());
List<Integer> deviceSubIds = new ArrayList<>(); List<Integer> deviceSubIds = new ArrayList<>();

Loading…
Cancel
Save