where clause not working with AND, JDBC/JAVA/SQL
The code below works fine when i remove this part (+"AND ref = '"+Mref.getText()+"'");)
but doesn’t work with it:
pst1= con.prepareStatement(" SELECT price from article where barcode = '"+Mbarcode.getText()+"'" +"AND ref = '"+Mref.getText()+"'");
ResultSet rs1 ;
rs1= pst1.executeQuery(); ```
this is the table named article in my database
barcodename |qty |price |vendor |ref maxremise