Advertisement
tko_pb

Untitled

Jul 4th, 2018
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1. String sqlquery = "select count(*) from c_file"
  2.               + " where ad_table_id=?"
  3.               + " and ad_record_id=?";
  4.       ConnectionProvider conn = new DalConnectionProvider();
  5.       Connection connection;
  6.       boolean hasAttachment = false;
  7.       try {
  8.           connection = conn.getConnection();
  9.           PreparedStatement ps = connection.prepareStatement(sqlquery);
  10.           ps.setString(1, "<diganti string table id nya requsition line>");
  11.           ps.setString(1, "<diganti string id requition line>");
  12.           ResultSet rs = ps.executeQuery();
  13.           while (rs.next())
  14.               hasAttachment=true;
  15.          
  16.       } catch (NoConnectionAvailableException e) {
  17.           e.printStackTrace();
  18.           throw new OBException(e.getMessage());
  19.       } catch (SQLException e) {
  20.           e.printStackTrace();
  21.           throw new OBException(e.getMessage());
  22.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement