hi every bady
my english is bad sorry
so, i have a problem in implement method named viewAllFactor(User us,ResultSet rs)
when i call this method using <T> like objet dont work because T obj is null
i ask if i can try something to have a good result
i have 2 classes BaseDao<T> (DAO Pattern) and Class User extends from BaseDao
this is the code
thiks
package appweb.core; public abstract class BaseDao<T> { public ArrayList<T> viewall() { ResultSet rset = null; ArrayList<T> listAll = new ArrayList<T>(); String sql = "SELECT* FROM "+ this.tableName; System.out.println(sql); try { PreparedStatement ps = this.connect.prepareStatement(sql); rset = ps.executeQuery(sql); while (rset.next()) { T obj ; [B][COLOR="#A52A2A"](mast initialis obj with null bath when i do that it s wrong in the call method viewAllFactor(obj,rset) [/COLOR][/B] this.viewAllFactor(obj,rset); listAll.add(obj); } rset.close(); ps.close(); } catch (SQLException e) { e.printStackTrace(); } return listAll; }sorry for my englishpublic class UserDao extends BaseDao<User> { ..... public void viewAllFactor(User u,ResultSet rs) { try{ u.setId(rs.getInt("id")); [COLOR="#800000"] error hier[/COLOR] u.setName(rs.getString("name")); u.setLogin(rs.getString("login")); u.setPass(rs.getString("pw")); u.setIdpr(rs.getInt("idProfil")); } catch (SQLException e) {e.printStackTrace();} }