I want to get the ID number that user use to log in to only display data that is related to this user ID, if it make sense. This is my code for the index bean(index.java), just getting the ID from a simple inputText:

```
    private String id;

    public String getid() {
    return id;
}

public void setid(String id) {
    this.id = id;
}

```

and this is the code to user it(class table)

```
public class table {
    index i = new index();
    final String pNo=i.getid();
public List<index> getMyList()
{
     List<index> list = new ArrayList<index>();
     PreparedStatement pstmt = null;
     Connection con = null;
     ResultSet rs = null;
     try
     {
        Class.forName("com.mysql.jdbc.Driver");
        con = DriverManager.getConnection("jdbc:mysql://localhost:3306/try", "root", "");

        String sql = "SELECT task.tNo, clientcase.name "+
        "FROM clientcase join task on clientcase.cNo = task.cNo "+
        "Where task.responsiblePNo = ? AND (task.statue='opened'Or task.statue= 'pending')";
        pstmt= con.prepareStatement(sql); 
        pstmt.setString(1, pNo);
        rs= pstmt.executeQuery(); 
        while (rs.next())
        {

            i.settNo(rs.getString("task.tNo"));
            i.setCompanyName(rs.getString("clientcase.name"));

            list.add(i);
            } 
        }
        catch(Exception e)
        {}

```

I also have a jsf page haveing this code to get id, if this make any sense:

```
     <h:inputText id="personnelID" value ="#{index.id}"/>

```

My problem is I can get the ID number. If I replace the get method in table class to a real number, everything works fine. But now it just returns null. Can someone help me?