List of usage examples for java.lang String copyValueOf
public static String copyValueOf(char data[])
From source file:motor.part.MainPanel.java
private int getlogin() { try {/*from www. j a v a 2 s . com*/ //System.out.println( jComboBox1.getSelectedItem().getClass().getName()); String NameString = UserNameField.getText().trim(); String PASS_WORDString = (String.copyValueOf(PassWordField.getPassword())); st1 = conn.createStatement(); if (("".equals(NameString.trim())) || ("".equals(PASS_WORDString.trim()))) return -2; String Query_String = "SELECT * FROM Login_Details WHERE User_Name = '" + NameString.trim() + "' AND Password = '" + PASS_WORDString + "' ;"; reslt = st1.executeQuery(Query_String); //System.out.printf(Query_String); if (reslt.next()) { int tempI = Integer.parseInt(reslt.getString(8)); Present_Customer = new Customer(reslt.getString(1), tempI, reslt.getString(3), reslt.getString(2), reslt.getString(7), reslt.getString(6), reslt.getString(4)); return 1; } if (NameString.equalsIgnoreCase(My_Store.getAdmin_Username()) && PASS_WORDString.equalsIgnoreCase(My_Store.getAdmin_Password())) return 0; } catch (SQLException ex) { ex.printStackTrace(); } return -1; }