- I need to retrive the list of users with similar interest
- Then, check to see if they are online - this has to do with session tracking
Meet AI 2027 Conference (Dec 1)
3 days ago
A collection of things, readings I stumble upon useful.
if (action.equals("view")){
try{
output = user.getUser(username);
md.searchGameByUserid(output, username);
md.searchAllFavorite(output, username);
user.searchSimilarUsers(output,username);
output.setAttribute("msgType", "view");
}catch(Exception ex){
output = user.getEmptyElement(username);
output.setAttribute("msgType", "saveNew");
}
}
The time stamp I used previously was from the template, and it doesn't show time very well. For example, 2009-07-21T13:06:44.670Z, a little hard to read. This is done using System.currentTimeMillis() from java.util.Date, which gives time to milliseconds, and was stored in mysql as a BIGINT.
However, there's a smart way to do this: mysql have a build-in type: TIMESTAMP, which will be responsible to keep track of time and display it properly when called. It can be called using command NOW().
String sql1 = "drop table metadata";These 2 lines of command tells the database to delete the metadata table. Then, when the servlet checks if there's a table to create, it will find none, and consequently create the new table with update.
DB.executeQuery(sql1);