alexandra84

statistic

Nov 2nd, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. public class shutoffWater {
  2.  
  3. public static void main(String[] args) {
  4. extractStatisticOne();
  5. }
  6.  
  7. private static void shutOffWaterSupply() {
  8. System.out.println("Shut Off Water Supply");
  9.  
  10. }
  11.  
  12.  
  13. private static void extractStatisticOne()
  14. {
  15.  
  16. System.out.println("Extract statistic 1");
  17.  
  18.  
  19. DB.selectSQL("SELECT * from tblCustomer where fldSegment=1 (select avg(fldWaterReadingLastTime) from tblWaterMeter)");
  20.  
  21. do{
  22. String data = DB.getDisplayData();
  23. if (data.equals(DB.NOMOREDATA)){
  24. break;
  25. }
  26. else
  27. System.out.print(data);
  28. }
  29. while (true);
  30. System.out.println("***********************************");
  31.  
  32. DB.selectSQL("SELECT * from tblCustomer where fldSegment=2 (select (fldWaterReadingLastTime) from tblWaterMeter)");
  33.  
  34. do{
  35. String data = DB.getDisplayData();
  36. if (data.equals(DB.NOMOREDATA)){
  37. break;
  38. }
  39. else
  40. System.out.print(data);
  41. }
  42. while (true);
  43. System.out.println("***********************************");
  44.  
  45.  
  46.  
  47. DB.selectSQL("SELECT * from tblCustomer where fldSegment=1 (select avg(fldWaterReadingThisTime) from tblWaterMeter)");
  48.  
  49. do{
  50. String data = DB.getDisplayData();
  51. if (data.equals(DB.NOMOREDATA)){
  52. break;
  53. }
  54. else
  55. System.out.print(data);
  56. }
  57. while (true);
  58. System.out.println("***********************************");
  59.  
  60. DB.selectSQL("SELECT * from tblCustomer where fldSegment=2 (select avg(fldWaterReadingThisTime) from tblWaterMeter)");
  61.  
  62. do{
  63. String data = DB.getDisplayData();
  64. if (data.equals(DB.NOMOREDATA)){
  65. break;
  66. }
  67. else
  68. System.out.print(data);
  69. }
  70. while (true);
  71. System.out.println("***********************************");
  72.  
  73. DB.selectSQL("SELECT * from tblCustomer where fldSegment=3 (select avg(fldWaterReadingThisTime) from tblWaterMeter)");
  74.  
  75. do{
  76. String data = DB.getDisplayData();
  77. if (data.equals(DB.NOMOREDATA)){
  78. break;
  79. }
  80. else
  81. System.out.print(data);
  82. }
  83. while (true);
  84. System.out.println("***********************************");
  85.  
  86. DB.selectSQL("SELECT * from tblCustomer where fldSegment=2 (select avg(fldWaterReadingLastTime) from tblWaterMeter)");
  87.  
  88. do{
  89. String data = DB.getDisplayData();
  90. if (data.equals(DB.NOMOREDATA)){
  91. break;
  92. }
  93. else
  94. System.out.print(data);
  95. }
  96. while (true);
  97. System.out.println("***********************************");
  98.  
  99. DB.selectSQL("SELECT difference(fldWaterReadingLastTime, fldWaterReadingThisTime) from tblWaterMeter");
  100.  
  101. do{
  102. String data = DB.getDisplayData();
  103. if (data.equals(DB.NOMOREDATA)){
  104. break;
  105. }
  106. else
  107. System.out.print(data);
  108. }
  109. while (true);
  110. System.out.println("***********************************");
  111.  
  112.  
  113. }
  114.  
  115. }
Advertisement
Add Comment
Please, Sign In to add comment