• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

gatting the details of the user

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi alll..

im presently working on jsp.my problem here is i just have to get the user names from the database and if i clicked on the name the perticular persons details shoul be displayed which are present in the data base.how can i do this im able to display all the names from the data base but the problem is abot displaying the details...so please help me out....
 
Rancher
Posts: 1946
15
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
// passing the name as querystring to another page might work




 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Swastik Dey,
Maybe I'm wrong but I think the code you posted is a good recipe for SQL injection attack.
A prepared statement is better in this situation.
 
Swastik Dey
Rancher
Posts: 1946
15
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Absolutely correct John , PreparedStatement is always a better option, however I just tried to give a clue.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,Swastik Dey may be given this code to give a clue. putting java stuff in jsp consider poor practise.it is not 1998

 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, writing raw Java code in JSP files is receipt for developerĀ“s trouble.

Write Java code in Java classes. This isnĀ“t 2001 anymore. We now have taglibs and EL to control the presentation flow in JSP.
 
Swastik Dey
Rancher
Posts: 1946
15
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fully agreed sir, we should distribute the code in model , view and controllers but for a beginner who might have just started learning jsp I dont find any thing wrong with this.
 
Sheriff
Posts: 67269
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem with showing poor practices to beginners is that they don't know it's a poor practice and learn by developing bad habits. If you are going to take shortcuts in an example, it's best to point it out so that they know it's just a simplified example that doesn't use proper practices.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!