LAPTOP-5NTQJPUS\LT 1 rok temu
rodzic
commit
84855b99ea
1 zmienionych plików z 10 dodań i 5 usunięć
  1. 10 5
      DataFusion/src/com/zskk/control/ViewController.java

+ 10 - 5
DataFusion/src/com/zskk/control/ViewController.java

@@ -46,8 +46,15 @@ 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
+			this.renderText(e.toString());
+
+		}
+		
 	}
 
 	public void testConn() {
@@ -152,9 +159,7 @@ public class ViewController extends Controller {
 		} catch (Exception e) {
 			// TODO: handle exception
 			this.renderText(e.toString());
-
-		}
-			
+		}		
 	}
 	
 	public void sdcfind() {