Login with SQL authentication in Java
<p>I'm trying to build a login UI with Java. But there is a problem with my SQL authentication</p>

<p>Here's the code:</p>

<pre><code>    public void actionPerformed(ActionEvent e){
            if (e.getSource() == Login)

                    try {
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                Connection con=DriverManager.getConnection("jdbc:odbc:MessageStore","sa","12345"); 
                Statement cmd=con.createStatement(); 
                ResultSet rs=cmd.executeQuery("select * from UserList where UserName='"+nameText.getText());
    }
</code></pre>

<p>But there is a warning with "rs":
The value of the local variable rs is not used</p>

<p>How to solve this problem?</p>

<p>Or is there more straightforward code to implement SQL authentication?</p>

<p>Thank you</p>
