I am trying to add value into SQLite database only if it not exist in database with Java using if statement. I am totally confused.
try{
String econ = String.valueOf(txt_economic.getText());
String malami = "Select * from MPA1 where econcd = ?";
pst = conn.prepareStatement(malami);
rs = pst.executeQuery();
while(rs.next()){
String econcdi = rs.getString("econcd");
if(econ.equals(econcdi) ){
try{
//Insert goes here
}catch(Exception e){
}