#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    2
    Rep Power
    0

    Highlighted keyword showing Not resolved


    Pls look at the below code , The highlighted attributes are showing " cannot be resolved " ,

    package com.programcreek.struts2;

    import java.sql.*;
    import java.io.*;
    import javax.servlet.*;


    import com.opensymphony.xwork2.ActionSupport;

    public class LoginAction extends ActionSupport{

    private String accountno;
    private String password;

    public String execute() {

    String accNo = getAccountno();
    String password = getPassword();


    Connection conn = null;
    String url = "jdbc:mysql://localhost:3306/";
    String dbName = "bank";
    String driver = "com.mysql.jdbc.Driver";
    String username = "root";
    String userPassword = "java";

    try {

    Class.forName(driver).newInstance();
    conn = DriverManager.getConnection(url+dbName,username,us erPassword);
    Statement st = conn.createStatement();
    String strQuery = "select count from user where accountNo='"+accNo+"' and password='"+password+"'";
    out.println(strQuery);
    ResultSet rs = st.executeQuery(strQuery);
    if(rs.next())
    {
    if(rs.getInt(1)>0)
    {
    session.setAttribute("useraccno",accNo);
    response.sendRedirect("Frame.jsp");
    }
    else
    {
    response.sendRedirect("login.jsp");
    }
    }
    System.out.println("Connected to the database");
    conn.close();
    System.out.println("Disconnected from database");
    } catch (Exception e) {
    e.printStackTrace();
    }
    }

    public String getAccountno() {
    return accountno;
    }

    public void setAccountno(String accountno) {
    this.accountno = accountno;
    }

    public String getPassword() {
    return password;
    }

    public void setPassword(String password) {
    this.password = password;
    }
    }


    someone pls revert this, whats wrong in the code????????? very urgent.....
  2. #2
  3. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    347
    Where are those symbols defined?

    Also See post on the other forum where you posted this.

    http://www.javaprogrammingforums.com/whats-wrong-my-code/10230-highlighted-words-not-resolved.html
    Last edited by NormR; August 4th, 2011 at 07:28 AM.

IMN logo majestic logo threadwatch logo seochat tools logo