help on datatable
Hi guys,
i've a simple help to ask you.
I'm working on datatables and i've read balusC article,that i think is fantastic.
I've an only problem,that is the edit mode of a datatable's row.
In the article there is the saveMyTable() method that i'm not able to complete!
This is my loadUsers() (loadMyTable() in the article)
publicvoid loadUsers()throws Exception{
Context ctx =new InitialContext();
if (ctx ==null){
thrownew Exception("Boom - No Context");
}
Context envCtx = (Context) ctx.lookup("java:comp/env");
DataSource ds = (DataSource) ctx.lookup("java:comp/env/MysqlJNDI");// "java:comp/env/jdbc/nomedb"
Connection conn = ds.getConnection();
Statement stm = conn.createStatement();
ResultSet rst = stm.executeQuery("select * from user order by username");
List users =new ArrayList();
while (rst.next()){
User myUser =new User();
myUser.setFirstName(rst.getString("firstname"));
myUser.setLastName(rst.getString("lastname"));
myUser.setCity(rst.getString("city"));
myUser.setPassword(rst.getString("password"));
myUser.setLogin(rst.getString("username"));
myUser.setTeamname(rst.getString("teamname"));
myUser.setRole(rst.getString("type"));
myUser.setDate(rst.getString("birthdate"));
myUser.setAddress(rst.getString("address"));
myUser.setProfession(rst.getString("profession"));
myUser.setEmail(rst.getString("email"));
users.add(myUser);
}
setUsers(users);
}
How can i save my modifies in the selected row?
I use JDBC,not Hibernate....thanks for your help

