Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class shutoffWater {
- public static void main(String[] args) {
- extractStatisticOne();
- }
- private static void shutOffWaterSupply() {
- System.out.println("Shut Off Water Supply");
- }
- private static void extractStatisticOne()
- {
- System.out.println("Extract statistic 1");
- DB.selectSQL("SELECT * from tblCustomer where fldSegment=1 (select avg(fldWaterReadingLastTime) from tblWaterMeter)");
- do{
- String data = DB.getDisplayData();
- if (data.equals(DB.NOMOREDATA)){
- break;
- }
- else
- System.out.print(data);
- }
- while (true);
- System.out.println("***********************************");
- DB.selectSQL("SELECT * from tblCustomer where fldSegment=2 (select (fldWaterReadingLastTime) from tblWaterMeter)");
- do{
- String data = DB.getDisplayData();
- if (data.equals(DB.NOMOREDATA)){
- break;
- }
- else
- System.out.print(data);
- }
- while (true);
- System.out.println("***********************************");
- DB.selectSQL("SELECT * from tblCustomer where fldSegment=1 (select avg(fldWaterReadingThisTime) from tblWaterMeter)");
- do{
- String data = DB.getDisplayData();
- if (data.equals(DB.NOMOREDATA)){
- break;
- }
- else
- System.out.print(data);
- }
- while (true);
- System.out.println("***********************************");
- DB.selectSQL("SELECT * from tblCustomer where fldSegment=2 (select avg(fldWaterReadingThisTime) from tblWaterMeter)");
- do{
- String data = DB.getDisplayData();
- if (data.equals(DB.NOMOREDATA)){
- break;
- }
- else
- System.out.print(data);
- }
- while (true);
- System.out.println("***********************************");
- DB.selectSQL("SELECT * from tblCustomer where fldSegment=3 (select avg(fldWaterReadingThisTime) from tblWaterMeter)");
- do{
- String data = DB.getDisplayData();
- if (data.equals(DB.NOMOREDATA)){
- break;
- }
- else
- System.out.print(data);
- }
- while (true);
- System.out.println("***********************************");
- DB.selectSQL("SELECT * from tblCustomer where fldSegment=2 (select avg(fldWaterReadingLastTime) from tblWaterMeter)");
- do{
- String data = DB.getDisplayData();
- if (data.equals(DB.NOMOREDATA)){
- break;
- }
- else
- System.out.print(data);
- }
- while (true);
- System.out.println("***********************************");
- DB.selectSQL("SELECT difference(fldWaterReadingLastTime, fldWaterReadingThisTime) from tblWaterMeter");
- do{
- String data = DB.getDisplayData();
- if (data.equals(DB.NOMOREDATA)){
- break;
- }
- else
- System.out.print(data);
- }
- while (true);
- System.out.println("***********************************");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment