私はテキストボックスを持っています。ユーザーがテキストボックスに名前を入力すると、テーブルから詳細を取得したい
String getTxt = text.getText();
ResultSet rs=st.executeQuery("SELECT * FROM authors_4 WHERE self_authors="+getTxt);
これを実行すると、例外が発生します
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
これに対する解決策は何ですか。助けが必要