• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what is the function of this line code?

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic