Guest User

Untitled

a guest
Oct 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. try {
  2. dbAccessSetUp();
  3. ResultSet rs = stmt.executeQuery("SELECT count(*) as total FROM taddress WHERE address_id = (SELECT address_id FROM tlink WHERE ext_id =" + this.ID + ")");
  4.  
  5. if(!rs.next()) {
  6. fail("Record does not exist in taddress");
  7. }
  8. int count = 0;
  9. while(rs.next()) {
  10. count = rs.getInt(1);
  11. System.out.println("number of count : " + count);
  12. assertTrue(0 < count);
  13. }
  14. rs.close();
  15. } catch(SQLException se) {
  16. se.printStackTrace();
  17. assertEquals(true, false);
  18. } catch(Exception e) {
  19. e.printStackTrace();
  20. assertEquals(true, false);
  21. } finally {
  22. try {
  23. if(stmt!=null) stmt.close();
  24. } catch(SQLException se2) {
  25. assertEquals(true, false);
  26. }
  27. try {
  28. if(conn!=null) conn.close();
  29. } catch(SQLException se) {
  30. se.printStackTrace();
  31. assertEquals(true, false);
  32. }
  33. }
Add Comment
Please, Sign In to add comment