Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Login Validation

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My code below don't validate from the database whether it is a valid user.WHY??It just print the Hi and the name.???


(Marilyn added code tags)
[ September 01, 2005: Message edited by: Marilyn de Queiroz ]
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At a glance, it looks okay to me.

Do you get any sql exceptions? Is your ResultSet always empty?

By the way, it's preferable to use preparedStatement because in your code, if my password is "' or 1=1", I think I can mess up your stuff, where else in preparedStatment, the input strings are masked.

Also, it is a good practice to close your resultset too.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks to me like you are over using the <html><body></body></html> tags. You really should only have one of each of these in your generated html code. You appear to be adding muliple copies of these in your resulting page. Check the source of your generated page in your browser to see what is actually on the page. Don't rely on what you see within the browser. It can be misleading.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with LEE. you can't have more than one <HTML><BODY></BODY></HTML> tag in a single page. just keep a single set of the above mentioned tag. In your check() , just add the <H2> tag.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unqualified Genius,

It appears that you have a lot of knowledge about Servlet programming and and are capable of contributing a lot to this forum. I hope that you will conform to the Javaranch naming policy as David has requested in several threads so that your account will remain open.

Looking forward to your future contribution.
-Ben
[ September 05, 2005: Message edited by: Ben Souther ]
 
There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic