Click here to Skip to main content
15,889,462 members
Home / Discussions / Java
   

Java

 
SuggestionRe: selecting numbers that is not between double/single qoutes with regular expression Pin
Richard MacCutchan29-Jul-13 20:59
mveRichard MacCutchan29-Jul-13 20:59 
QuestionNot able to add my hash password into my database(mssql) Pin
chdboy25-Jul-13 23:11
chdboy25-Jul-13 23:11 
AnswerRe: Not able to add my hash password into my database(mssql) Pin
pa1joc26-Jul-13 2:54
pa1joc26-Jul-13 2:54 
GeneralRe: Not able to add my hash password into my database(mssql) Pin
chdboy26-Jul-13 19:18
chdboy26-Jul-13 19:18 
GeneralRe: Not able to add my hash password into my database(mssql) Pin
Richard MacCutchan26-Jul-13 22:28
mveRichard MacCutchan26-Jul-13 22:28 
QuestionJava Server App : Request advice Pin
ptr_Electron25-Jul-13 6:22
ptr_Electron25-Jul-13 6:22 
AnswerRe: Java Server App : Request advice Pin
Richard MacCutchan25-Jul-13 7:05
mveRichard MacCutchan25-Jul-13 7:05 
QuestionUsername ,Password Validation Pin
chdboy23-Jul-13 22:16
chdboy23-Jul-13 22:16 
I want to validate Username and Password matching from my sql Database,but it didn't work.Even if the text fields are blank it does not give any error.

Java
private static void selectfromdb() throws SQLException
	{	
	    Statement stmt = Connectionstring().createStatement();
		ResultSet rs = stmt.executeQuery("SELECT Username,Password FROM LoginDetails where Username='"+tf_Fname+"' AND Password ='"+tf_Lname+"'");
		while (rs.next())
		{  
            String x = tf_Fname.getText();              
            String pass = new String(tf_Lname.getPassword());
            if (x.equals(rs.getString("Username"))) 
            {  
                if (pass.equals(rs.getString("Password")))
                {  
                	JOptionPane.showMessageDialog(null,"Login Successful! ","Success",JOptionPane.WARNING_MESSAGE);
                    //System.out.println("Logged in!");  
                }
                else
                {  
                	JOptionPane.showMessageDialog(null,"Login UNSuccessful! ","UNSuccessful",JOptionPane.WARNING_MESSAGE);
                   // System.out.println("Password did not match username!");  
                }  
            }  
        }             
				
		}

AnswerRe: Username ,Password Validation Pin
Blue_Boy23-Jul-13 22:58
Blue_Boy23-Jul-13 22:58 
GeneralRe: Username ,Password Validation Pin
Richard MacCutchan24-Jul-13 0:33
mveRichard MacCutchan24-Jul-13 0:33 
GeneralRe: Username ,Password Validation Pin
Blue_Boy24-Jul-13 1:31
Blue_Boy24-Jul-13 1:31 
GeneralRe: Username ,Password Validation Pin
chdboy24-Jul-13 3:08
chdboy24-Jul-13 3:08 
AnswerRe: Username ,Password Validation Pin
Richard MacCutchan24-Jul-13 5:03
mveRichard MacCutchan24-Jul-13 5:03 
AnswerRe: Username ,Password Validation Pin
chdboy24-Jul-13 22:02
chdboy24-Jul-13 22:02 
GeneralRe: Username ,Password Validation Pin
Richard MacCutchan24-Jul-13 22:20
mveRichard MacCutchan24-Jul-13 22:20 
GeneralRe: Username ,Password Validation Pin
chdboy25-Jul-13 4:04
chdboy25-Jul-13 4:04 
GeneralRe: Username ,Password Validation Pin
Richard MacCutchan25-Jul-13 4:47
mveRichard MacCutchan25-Jul-13 4:47 
GeneralRe: Username ,Password Validation Pin
chdboy25-Jul-13 5:01
chdboy25-Jul-13 5:01 
AnswerRe: Username ,Password Validation Pin
jschell24-Jul-13 9:48
jschell24-Jul-13 9:48 
GeneralRe: Username ,Password Validation Pin
chdboy24-Jul-13 22:28
chdboy24-Jul-13 22:28 
QuestionObject mutability Pin
Neo1010121-Jul-13 3:03
Neo1010121-Jul-13 3:03 
AnswerRe: Object mutability Pin
Richard MacCutchan21-Jul-13 20:33
mveRichard MacCutchan21-Jul-13 20:33 
GeneralRe: Object mutability Pin
Neo1010122-Jul-13 0:32
Neo1010122-Jul-13 0:32 
GeneralRe: Object mutability Pin
Richard MacCutchan22-Jul-13 1:44
mveRichard MacCutchan22-Jul-13 1:44 
Questioncomplete spring example to get datasource from websphere Pin
swarjava20-Jul-13 7:03
swarjava20-Jul-13 7:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.