I am a beginner in j2ee.I wanaa know how I can prevent sql injection in j2ee applications,thanks
this completely depends on your architecture and your components!this is a general method working for any web application including J2EE ones:when ever you have a usecase that client can enter a text that will be used as a part of a sql check it to make sure it has not included any SQL.
you can prevent SQL injection via named queries in ORMs or PreparedStatement in JDBC.
you can impl this functionality , but org.apache.commons.langhave same component for this usage see it , org.apache.commons.lang.StringEscapeUtils