私はこの問題に苦しんでおり、何らかの理由で解決できません。
Connection conn = null;
PreparedStatement ps = null;
String query = "INSERT INTO " + "tags" + "(Name, Income, Expense) VALUES(?,?,?)";
ps = conn.prepareStatement(query);
ps.setString(1, tag);
ps.setString(2, amount_);
ps.setString(3, "0");
ps.executeQuery();
Tag
はユーザー入力からの文字列であり、ユーザーは引き続き SQL インジェクションを送信できます! どうして??また、この Eclipse エラーが発生しています: Null pointer access: The variable conn can only be null at this location
.