📄 quicksearchmanager.java
字号:
String res = ""; int count = 0; String query = "select shop_name,shop_type,facilities,city,latitude,longitude from shop,address where shop.address_id=address.address_id and shop_name like '%"+name.toUpperCase()+"%' or shop_type like '%"+name.toUpperCase()+"%'"; System.out.println(query); try { ResultSet rs = getStatement().executeQuery(query); while (rs.next()) { res += rs.getString(1) + ":" + rs.getString(2) + ":"+rs.getString(3) + ":" + rs.getString(4) + ":"+rs.getString(5) + ":" + rs.getString(6) + ":"; res += "#"; } if(res.equals("")) { res="notfound"; res+="#"; } } catch (Exception e) { e.printStackTrace(); } return res;}public String searchShops() { String res = ""; int count = 0; String query = "select shop_name,shop_type,facilities,city,latitude,longitude from shop,address where shop.address_id=address.address_id"; System.out.println(query); try { ResultSet rs = getStatement().executeQuery(query); while (rs.next()) { res += rs.getString(1) + ":" + rs.getString(2) + ":"+rs.getString(3) + ":" + rs.getString(4) + ":"+rs.getString(5) + ":" + rs.getString(6) + ":"; res += "#"; } if(res.equals("")) { res="notfound"; res+="#"; } } catch (Exception e) { e.printStackTrace(); } return res;}public String searchPetrolpump(String name, String keyword) { String res = ""; int count = 0; String query = "select petrolpump_name,petrolpump_type,petrolpump_speciality,city,latitude,longitude from petrolpump,address where petrolpump.address_id=address.address_id and petrolpump_name like '%"+name.toUpperCase()+"%' and petrolpump_type like '%"+keyword.toUpperCase()+"%'"; System.out.println(query); try { ResultSet rs = getStatement().executeQuery(query); while (rs.next()) { res += rs.getString(1) + ":" + rs.getString(2) + ":"+rs.getString(3) + ":" + rs.getString(4) + ":"+rs.getString(5) + ":" + rs.getString(6) + ":"; res += "#"; } if(res.equals("")) { res="notfound"; res+="#"; } } catch (Exception e) { e.printStackTrace(); } return res;}public String searchPetrolpump(String name) { String res = ""; int count = 0; String query = "select petrolpump_name,petrolpump_type,petrolpump_speciality,city,latitude,longitude from petrolpump,address where petrolpump.address_id=address.address_id and petrolpump_name like '%"+name.toUpperCase()+"%' or petrolpump_type like '%"+name.toUpperCase()+"%'"; System.out.println(query); try { ResultSet rs = getStatement().executeQuery(query); while (rs.next()) { res += rs.getString(1) + ":" + rs.getString(2) + ":"+rs.getString(3) + ":" + rs.getString(4) + ":"+rs.getString(5) + ":" + rs.getString(6) + ":"; res += "#"; } if(res.equals("")) { res="notfound"; res+="#"; } } catch (Exception e) { e.printStackTrace(); } return res;} public String searchPetrolpump() { String res = ""; int count = 0; String query = "select petrolpump_name,petrolpump_type,petrolpump_speciality,city,latitude,longitude from petrolpump,address where petrolpump.address_id=address.address_id"; System.out.println(query); try { ResultSet rs = getStatement().executeQuery(query); while (rs.next()) { res += rs.getString(1) + ":" + rs.getString(2) + ":"+rs.getString(3) + ":" + rs.getString(4) + ":"+rs.getString(5) + ":" + rs.getString(6) + ":"; res += "#"; } if(res.equals("")) { res="notfound"; res+="#"; } } catch (Exception e) { e.printStackTrace(); } return res;} public String searchReligiousSpots(String name, String keyword) { String res = ""; int count = 0; String query = "select rs_name,mythology,history,city,latitude,longitude from religiousspots,address where religiousspots.address_id=address.address_id and rs_name like '%"+name.toUpperCase()+"%' and mythology like '%"+keyword.toUpperCase()+"%'"; System.out.println(query); try { ResultSet rs = getStatement().executeQuery(query); while (rs.next()) { res += rs.getString(1) + ":" + rs.getString(2) + ":"+rs.getString(3) + ":" + rs.getString(4) + ":"+rs.getString(5) + ":" + rs.getString(6) + ":"; res += "#"; } if(res.equals("")) { res="notfound"; res+="#"; } } catch (Exception e) { e.printStackTrace(); } return res;}public String searchReligiousSpots(String name) { String res = ""; int count = 0; String query = "select rs_name,mythology,history,city,latitude,longitude from religiousspots,address where religiousspots.address_id=address.address_id and rs_name like '%"+name.toUpperCase()+"%' or mythology like '%"+name.toUpperCase()+"%'"; System.out.println(query); try { ResultSet rs = getStatement().executeQuery(query); while (rs.next()) { res += rs.getString(1) + ":" + rs.getString(2) + ":"+rs.getString(3) + ":" + rs.getString(4) + ":"+rs.getString(5) + ":" + rs.getString(6) + ":"; res += "#"; } if(res.equals("")) { res="notfound"; res+="#"; } } catch (Exception e) { e.printStackTrace(); } return res;}public String searchReligiousSpots() { String res = ""; int count = 0; String query = "select rs_name,mythology,history,city,latitude,longitude from religiousspots,address where religiousspots.address_id=address.address_id"; System.out.println(query); try { ResultSet rs = getStatement().executeQuery(query); while (rs.next()) { res += rs.getString(1) + ":" + rs.getString(2) + ":"+rs.getString(3) + ":" + rs.getString(4) + ":"+rs.getString(5) + ":" + rs.getString(6) + ":"; res += "#"; } if(res.equals("")) { res="notfound"; res+="#"; } } catch (Exception e) { e.printStackTrace(); } return res;}public String searchResturants(String name,String keyword){ String res = ""; int count = 0; String query = "select resturant_name,resturant_type,resturant_menu,city,latitude,longitude from resturant,address where resturant.address_id=address.address_id and resturant_name like '%"+name.toUpperCase()+"%' and resturant_type like '%"+keyword.toUpperCase()+"%'"; System.out.println(query); try { ResultSet rs = getStatement().executeQuery(query); while (rs.next()) { res += rs.getString(1) + ":" + rs.getString(2) + ":"+rs.getString(3) + ":" + rs.getString(4) + ":"+rs.getString(5) + ":" + rs.getString(6) + ":"; res += "#"; } if(res.equals("")) { res="notfound"; res+="#"; } } catch (Exception e) { e.printStackTrace(); } return res;}public String searchResturants(String name){ String res = ""; int count = 0; String query = "select resturant_name,resturant_type,resturant_menu,city,latitude,longitude from resturant,address where resturant.address_id=address.address_id and resturant_name like '%"+name.toUpperCase()+"%' or resturant_type like '%"+name.toUpperCase()+"%'"; System.out.println(query); try { ResultSet rs = getStatement().executeQuery(query); while (rs.next()) { res += rs.getString(1) + ":" + rs.getString(2) + ":"+rs.getString(3) + ":" + rs.getString(4) + ":"+rs.getString(5) + ":" + rs.getString(6) + ":"; res += "#"; } if(res.equals("")) { res="notfound"; res+="#"; } } catch (Exception e) { e.printStackTrace(); } return res;}public String searchResturants(){ String res = ""; int count = 0; String query = "select resturant_name,resturant_type,resturant_menu,city,latitude,longitude from resturant,address where resturant.address_id=address.address_id"; System.out.println(query); try { ResultSet rs = getStatement().executeQuery(query); while (rs.next()) { res += rs.getString(1) + ":" + rs.getString(2) + ":"+rs.getString(3) + ":" + rs.getString(4) + ":"+rs.getString(5) + ":" + rs.getString(6) + ":"; res += "#"; } if(res.equals("")) { res="notfound"; res+="#"; } } catch (Exception e) { e.printStackTrace(); } return res;}public String searchTourLocations(String name,String keyword){ String res = ""; int count = 0; String query = "select tourlocation_name,tourlocation_description,tourlocation_speciality,city,latitude,longitude from tourlocation,address where tourlocation.address_id=address.address_id and tourlocation_name like '%"+name.toUpperCase()+"%' and tourlocation_speciality like '%"+keyword.toUpperCase()+"%'"; System.out.println(query); try { ResultSet rs = getStatement().executeQuery(query); while (rs.next()) { res += rs.getString(1) + ":" + rs.getString(2) + ":"+rs.getString(3) + ":" + rs.getString(4) + ":"+rs.getString(5) + ":" + rs.getString(6) + ":"; res += "#"; } if(res.equals("")) { res="notfound"; res+="#"; } } catch (Exception e) { e.printStackTrace(); } return res;}public String searchTourLocations(String name){ String res = ""; int count = 0; String query = "select tourlocation_name,tourlocation_description,tourlocation_speciality,city,latitude,longitude from tourlocation,address where tourlocation.address_id=address.address_id and tourlocation_name like '%"+name.toUpperCase()+"%' or tourlocation_speciality like '%" + name.toUpperCase() + "%'"; System.out.println(query); try { ResultSet rs = getStatement().executeQuery(query); while (rs.next()) { res += rs.getString(1) + ":" + rs.getString(2) + ":"+rs.getString(3) + ":" + rs.getString(4) + ":"+rs.getString(5) + ":" + rs.getString(6) + ":"; res += "#"; } if(res.equals("")) { res="notfound"; res+="#"; } } catch (Exception e) { e.printStackTrace(); } return res;}public String searchTourLocations(){ String res = ""; int count = 0; String query = "select tourlocation_name,tourlocation_description,tourlocation_speciality,city,latitude,longitude from tourlocation,address where tourlocation.address_id=address.address_id "; System.out.println(query); try { ResultSet rs = getStatement().executeQuery(query); while (rs.next()) { res += rs.getString(1) + ":" + rs.getString(2) + ":"+rs.getString(3) + ":" + rs.getString(4) + ":"+rs.getString(5) + ":" + rs.getString(6) + ":"; res += "#"; } if(res.equals("")) { res="notfound"; res+="#"; } } catch (Exception e) { e.printStackTrace(); } return res;}public static void main(String[] args) { // QuickSearchManager Qmanager = new QuickSearchManager(); // Qmanager.SearchOnGps(); QuickSearchManager quicksearch ; quicksearch = new QuickSearchManager(8.518796f,76.942266f); String rse = quicksearch.searchLocations("Pattom","Horizon"); System.out.println(rse); } public float getLatitude() { return latitude; } public void setLatitude(float latitude) { this.latitude = latitude; } public float getLongitude() { return longitude; } public void setLongitude(float longitude) { this.longitude = longitude; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -