@@ -0,0 +1,1536 @@
+package ozeki;%0A%0Aimport java.sql.ResultSet;%0Aimport java.sql.SQLException;%0A%0Aimport com.mysql.jdbc.Statement;%0A%0Apublic class Ads %7B%0A%0A%09String origin;%0A%09String destination;%0A%09String place;%0A%09%0A%09String message =%22%22;%0A%09String title;%0A%09String address;%0A%09%0A%09Statement smnt;%0A%09ResultSet rs = null;%0A%09%0AAds() %7B%0A%09%0A%7D%0A%09%0AAds(String origin, String destination, Statement smnt) %7B%0A%09this.origin = origin;%0A%09this.destination = destination;%0A%09this.smnt = smnt;%0A%7D%0A%0Aboolean queryDB(String place) %7B%0A%09%0A%09boolean bool = false;%0A%09%0A%09String query = %22SELECT * FROM ads WHERE area = '%22+place+%22';%22;%0A%09%0A%09%09%09try %7B%0A%0A%09%09%09%09rs = smnt.executeQuery(query);%09%09%0A%09%09%09%09%0A%09%09%09%09if(!rs.isBeforeFirst()) %7B%0A%09%09%09%09%09bool = false;%0A%09%09%09%09%09%0A%09%09%09%09%7D%0A%09%09%09%09else%09%09%09%09%09%0A%09%09%09%09  %7B %0A%09%09%09%09%09while(rs.next()) %7B%0A%09%09              title   = rs.getString(%22title%22);%0A%09%09              address = rs.getString(%22address%22);                  %0A%09%09%09%09%09%7D%0A%09%09%09%09%09%0A%09%09%09%09%09this.place = place;%0A%0A%09%09%09%09%09bool = true;%0A%0A%09%09          %7D%0A%09%09%09%09%0A%09%09%09%7D catch (SQLException e) %7B%0A%09%09%09%09// TODO Auto-generated catch block%0A%09%09%09%09e.printStackTrace();%0A%09%09%09%7D%0A%0A%09%09%09%0A%09%09%09return bool;%09%09%09%0A%09%09%09%0A%7D%0A%0Avoid getAdsDataFromDB() %7B%0A%09%0A%09if(!queryDB(origin)) %7B%0A%09%09%0A%0A%09%09%0A%09%09if(!queryDB(destination)) %7B%0A%09%09%09%0A%09%09%09place = null;%0A%09%09%09title = null;%0A%09%09%09address = null;%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A%0AString createAds() %7B%0A%09%0A%09message += %22Going to %22+destination+%22?%5Cn%22;%0A%09message += %22Book a Uber Cab NOW and GET Rs.400/- off with coupon:GRAB400%5Cn%22;%0A%09message += %22Call +1-866-576-1039.%5Cn%5Cn%22;%0A%0A%09if(title!=null && place!=null && address!=null) %7B%0A%09message += %22Please visit %22+title+%22 at %22+place+%22.%5Cn%22;%0A%09message += address+%22.%5Cn%22;%0A%09%7D%0A%09%09return message;%0A%7D%0A%7D%0A

Create Ads.java