Advertisement
Guest User

gg

a guest
May 25th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. String vegetable_id = vegetable_idtxt.getText();
  2. int planting = Integer.parseInt(PlantingInstructionCodetxt.getText());
  3. int soiltype = Integer.parseInt(RecommendedSoilTypeCodetxt.getText());
  4. int sowing = Integer.parseInt(SowingInstructionCodetxt.getText());
  5. String besttimetosow = BestTimetoSowtxt.getText();
  6. String besttimetoharvest = BestTimetoHarvesttxt.getText();
  7.  
  8.  
  9.  
  10. StringBuilder sql = new StringBuilder("INSERT INTO vegetables (vegetable_id,best_time_to_harvest,best_time_to_sow,planting_instruction_code,recommended_soil_type_code,sowing_instruction_code) VALUES (\'");
  11. sql.append(vegetable_id);
  12. sql.append("\',\'");
  13. sql.append(besttimetoharvest);
  14. sql.append("\',\'");
  15. sql.append(besttimetosow);
  16. sql.append("\',\'");
  17. sql.append(planting);
  18. sql.append("\',\'");
  19. sql.append(soiltype);
  20. sql.append("\',\'");
  21. sql.append(sowing);
  22. sql.append("\')");
  23. System.out.println( sql.toString() );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement