ViewController.java 568 B

1234567891011121314151617181920212223242526
  1. package com.zskk.control;
  2. import java.util.List;
  3. import com.jfinal.core.Controller;
  4. import com.jfinal.plugin.activerecord.Db;
  5. import com.jfinal.plugin.activerecord.Record;
  6. import com.zskk.model.Reports;
  7. public class ViewController extends Controller {
  8. /**
  9. * 在被连接数据库执行sql语句
  10. */
  11. public void executeSql() {
  12. try {
  13. List<Reports> d = Reports.dao.use("zskk").find("SELECT * FROM doctors where hid = 74100001");
  14. this.renderJson(d);
  15. } catch (Exception e) {
  16. // TODO: handle exception
  17. this.renderText(e.toString());
  18. }
  19. }
  20. }