Tuesday, March 11, 2014

Oracle Java Checking Null Values

private boolean find_product_sl(String sl) {

        try {
            String sql = "Select ID as L from INV_ITEM_SPEC where ITEM_SL_NO = ? and DEBTORS_ID is null";
            pst = conn.prepareStatement(sql);
            pst.setObject(1, sl);
            ResultSet rsc = pst.executeQuery();

            if (rsc.next())
                 return true;
            else return false;

        } catch (Exception e) {

            JOptionPane.showMessageDialog(null, "Connecitivity Problems x" + e, "Invalid", JOptionPane.ERROR_MESSAGE);

        }
        return false;
    }

No comments:

Post a Comment