I have a textbox. When the user enters the name in the textbox I want the details fetched from the table
String getTxt = text.getText();
ResultSet rs=st.executeQuery("SELECT * FROM authors_4 WHERE self_authors="+getTxt);
On executing this i'm getting exception
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
What is the solution to this. Need help