| | |
| | | /** |
| | | * Copyright (c) 2018 人人开源 All rights reserved. |
| | | * |
| | | * <p> |
| | | * https://www.renren.io |
| | | * |
| | | * <p> |
| | | * 版权所有,侵权必究! |
| | | */ |
| | | |
| | |
| | | eqList.add(json); |
| | | } |
| | | jsonObject.put("eqList", eqList); |
| | | |
| | | DbProperties jdbc = queryJdbcProperties(); |
| | | |
| | | DataTable table = null; |
| | | Connection conn = null; |
| | | try { |
| | | // 注册数据库驱动 |
| | | Class.forName(jdbc.getDriverClass()); |
| | | Properties props = new Properties(); |
| | | props.put("remarksReporting", "true");// 为了得到说明 |
| | | props.setProperty("user", jdbc.getUserName()); |
| | | props.setProperty("password", jdbc.getPassWord()); |
| | | // 获取连接 |
| | | conn = DriverManager.getConnection(jdbc.getUrl(), props); |
| | | table = DBUtil.getTableList(conn, false); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | if (conn != null) { |
| | | try { |
| | | conn.close(); |
| | | } catch (SQLException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | jsonObject.put("tableList", table.toJSONArray()); |
| | | return Result.ok(jsonObject); |
| | | } |
| | | |