|
|
@ -299,7 +299,13 @@ public class ApplicationDAOImpl implements ApplicationDAO {
|
|
|
|
if (filter != null) {
|
|
|
|
if (filter != null) {
|
|
|
|
sql = sql + "AND NAME LIKE ? ";
|
|
|
|
sql = sql + "AND NAME LIKE ? ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean isLimitPresent = false;
|
|
|
|
|
|
|
|
if (request.getRowCount() > 0) {
|
|
|
|
sql = sql + "LIMIT ? OFFSET ?";
|
|
|
|
sql = sql + "LIMIT ? OFFSET ?";
|
|
|
|
|
|
|
|
isLimitPresent = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Connection conn = this.getConnection();
|
|
|
|
Connection conn = this.getConnection();
|
|
|
|
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
|
|
|
|
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
|
|
|
|
int paramIdx = 1;
|
|
|
|
int paramIdx = 1;
|
|
|
@ -308,8 +314,10 @@ public class ApplicationDAOImpl implements ApplicationDAO {
|
|
|
|
if (filter != null){
|
|
|
|
if (filter != null){
|
|
|
|
stmt.setString(paramIdx++, filter);
|
|
|
|
stmt.setString(paramIdx++, filter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isLimitPresent) {
|
|
|
|
stmt.setInt(paramIdx++, request.getRowCount());
|
|
|
|
stmt.setInt(paramIdx++, request.getRowCount());
|
|
|
|
stmt.setInt(paramIdx, request.getStartIndex());
|
|
|
|
stmt.setInt(paramIdx, request.getStartIndex());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try (ResultSet rs = stmt.executeQuery()) {
|
|
|
|
try (ResultSet rs = stmt.executeQuery()) {
|
|
|
|
while (rs.next()) {
|
|
|
|
while (rs.next()) {
|
|
|
|