i am trying complete a simple login where the username and password are flat within the program...... i have absolutely no idea on how to do it! i am using a jdialogue form in netbeans and have designed the facial however i simply dont now how to compare what is entered to what is not!. Can anybody help me? Thanks

6 Years
Discussion Span
Last Post by mKorbel

I assume you want to compare what you've entered to what you get out of a database.
use a jdbc connector to communicate with the database, retreive the data (being a username and a password) out of the database, and use the .equals(Object o) method to compare the values that you got from the database to those you've entered


please (if isn't there Ldap, AD...) be sure that you don't store sesitive (User + Psw) data in String form somewhere in your App, because all String variable (private Strin UseName = "John";) are readable (runnable compilated code) from any fileViewer (after compilation there you can find out "John"), that's meaning not only Java, majorities of programing languages, just hold it in binaries form

good request look like:

Select DateOfExpiry from UserTable where UserName = 'SomeName' and PassWord = 'SomePsw'

Select count(*) from UserTable where UserName = 'SomeName' and PassWord = 'SomePsw'// sure hoping that positive returns is only 1, but nobody know in the largiest companies
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.