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

Recommended Answers

All 2 Replies

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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.