java - SQL error or missing database (no such column: RollNo) -


i writing java code using eclipse ide , sqlite (as database) , on executing sql query using statements:

string query="select name,surname,fees,rollno,adno student class='"+1+"'"; preparedstatement pst=c.preparestatement(query); resultset rs=pst.executequery(); 

i got error:

sql error or missing database (no such column: rollno)

where name,surname,fees,rollno,adno valid , exact names of columns in table student

but when passing query(given below) using same set of statements displaying whole table correctly

string query="select * student class='"+1+"'"; preparedstatement pst=c.preparestatement(query); resultset rs=pst.executequery(); 

what problem code need rename columns although have tried names roll_no , ad_no showing same error.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -