Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GUI to verify database login/pwd

 
Artemesia Lakener
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to write a very simple GUI asking user to input his/her database uid and pwd. If the login is accepted or rejected, they will see the corresponding pages. Just wondering how to check if the uid/pwd for database is correct ? just try to build a database Connection using the GUI's input uid/pwd ? and if there is no SQLException then it is ok, or it fails ? But it seems SQLException can be caused by other database problem other than incorrect uid/pwd... How to exactly check if the uid/pwd is correct ?

thanks.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Artemesia,
You need to check the error code of the "SQLException" to see the exact nature of the exception. I suggest code similar to the following:
[NOTE: Uncompiled and untested.]

Good Luck,
Avi.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic