Пример #1
0
 public News(int id) throws Exception {
   Database db = new Database();
   db.connect();
   News news = News.findById(db, id);
   db.close();
   this.id = news.id;
   this.tmsp = news.tmsp;
   this.headline = news.headline;
   this.body = news.body;
   this.email = news.email;
 }
Пример #2
0
 public static void main(String args[]) throws Exception {
   News news = new News();
   news.setHeadline("Testando");
   news.setTmsp("2011-04-11 11:00:00");
   news.setBody("Body");
   news.setEmail("*****@*****.**");
   news.insert();
 }
Пример #3
0
 public static News findById(Database db, int id) throws Exception {
   return News.next(
       db.query("select id, tmsp, headline, body, email from tbNews where id = " + id));
 }