Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- dbAccessSetUp();
- ResultSet rs = stmt.executeQuery("SELECT count(*) as total FROM taddress WHERE address_id = (SELECT address_id FROM tlink WHERE ext_id =" + this.ID + ")");
- if(!rs.next()) {
- fail("Record does not exist in taddress");
- }
- int count = 0;
- while(rs.next()) {
- count = rs.getInt(1);
- System.out.println("number of count : " + count);
- assertTrue(0 < count);
- }
- rs.close();
- } catch(SQLException se) {
- se.printStackTrace();
- assertEquals(true, false);
- } catch(Exception e) {
- e.printStackTrace();
- assertEquals(true, false);
- } finally {
- try {
- if(stmt!=null) stmt.close();
- } catch(SQLException se2) {
- assertEquals(true, false);
- }
- try {
- if(conn!=null) conn.close();
- } catch(SQLException se) {
- se.printStackTrace();
- assertEquals(true, false);
- }
- }
Add Comment
Please, Sign In to add comment