• 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

how to make a method in database access class for login

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys, how to make a method for Database Access class for login? Need some help quick.Thanks in advance


This is what I got so far
 
security forum advocate
Posts: 236
1
Android Flex Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So are you stuck on an error or something???
 
Mustafa Okbar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ive got a servlet, database and jsp consiting of; connection to postgres with a method that will pass username and password to it. From this it will then be called in the servlet to create an if loop to check if the password and username match, from this a boolean variable in the person class, is changed to true and the servlet will redirect. The jsp is to show the form. this is the breakdown of how it goes:


here is the servlet (note it isnt finished but the logic i talk about before will be implemented




and finally the jsp



Our problem is in the servlet the if statement, i am unsure of what to pass and whether to have a .equals class. If so how do i show that active(boolean variable in person class) is true so that it can redirect them to their profilePage or redirect them appropriately!


Many thanks in advance,
Ilyas
p.s will be highly appreciated!
 
Sai Hegde
security forum advocate
Posts: 236
1
Android Flex Google App Engine
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well, assuming that you are working on a beginners project, here is some direction that you'd need...

The logIn() method returns a Person object if the userName and password match, else it returns null... So your code would be



Hope, this helps!
 
Mustafa Okbar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since we have change this we have got erros((( Is my code not right?

 
Mustafa Okbar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sai, thanks a lot, your code helped us.^^ Eventually we got that chicky login
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mustafa, Welcome to the Ranch!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic