刘韬 3 years ago
parent
commit
9926fce8f3
1 changed files with 8 additions and 2 deletions
  1. 8 2
      DataFusion/src/com/zskk/control/ViewController.java

+ 8 - 2
DataFusion/src/com/zskk/control/ViewController.java

@@ -35,8 +35,14 @@ public class ViewController extends Controller {
 	 * 在被连接数据库执行sql语句
 	 */
 	public void executeSql() {
-		List<Record> d = Db.use("connected").find(this.getPara("sqlstr"));
-		this.renderJson(d);
+		try {
+			List<Record> d = Db.use("connected").find(this.getPara("sqlstr"));
+			this.renderJson(d);
+		} catch (Exception e) {
+			// TODO: handle exception
+			renderText(e.toString());
+		}
+		
 	}
 
 	public void testConn() {