• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the function of this line code?

 
vijay joseph
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends, can anyone tell me what is the function of following lines in servlet?what is the difference between prepareStatement,PreparedStatement?
Connection con;
PreparedStatement pstmt=null;
query="select emp_fname, emp_lname, address, dept, age, desig from Employee_master where emp_id=?";

pstmt=con.prepareStatement(query);
pstmt.setInt(1,Integer.parseInt(req.getParameter("emp_id")));
[ March 02, 2007: Message edited by: vijay joseph ]
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you just need to read this one page and I am 100% sure that this page will be clear and proficient to you in using Prepared Statement.

[Edited]
Suggestion:

Javaranch have separate room for Database related query with the name of JDBC.
please choose appropriate room before posting you question.
[ March 02, 2007: Message edited by: Saif uddin ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic