|
@@ -1,6 +1,11 @@
|
|
|
package com.diagbot.web;
|
|
|
|
|
|
+import java.sql.Connection;
|
|
|
+import java.sql.DriverManager;
|
|
|
+import java.sql.PreparedStatement;
|
|
|
+import java.sql.ResultSet;
|
|
|
import java.util.List;
|
|
|
+import java.util.Scanner;
|
|
|
|
|
|
import com.diagbot.facade.MrFacade;
|
|
|
import com.diagbot.vo.PushJoinVO;
|
|
@@ -100,6 +105,36 @@ public class InquiryInfoController {
|
|
|
@PostMapping("/getDataService")
|
|
|
@SysLogger("getDataService")
|
|
|
public String getDataService(PushJoinVO pushJoinVO){
|
|
|
+
|
|
|
+ String username = "root";
|
|
|
+ // 数据库连接密码
|
|
|
+ String password = "langtong";
|
|
|
+ String driver = "com.mysql.jdbc.Driver";
|
|
|
+ // 其中test为数据库名称
|
|
|
+ String url="jdbc:oracle:thin:@192.168.3.177:1521:orcl";
|
|
|
+ // String url = "jdbc:mysql://localhost:3306/sys-icss";
|
|
|
+ Connection conn = null;
|
|
|
+ try {
|
|
|
+ Class.forName(driver);
|
|
|
+ conn = (Connection) DriverManager.getConnection(url, username, password);
|
|
|
+ System.out.println("请输入SQL语句:");
|
|
|
+ Scanner input = new Scanner(System.in);
|
|
|
+ input.useDelimiter("\n");
|
|
|
+ String sql = input.next();
|
|
|
+
|
|
|
+ PreparedStatement pst = null;
|
|
|
+ pst = (PreparedStatement) conn.prepareStatement(sql);
|
|
|
+ ResultSet rs = pst.executeQuery();
|
|
|
+ while(rs.next()){
|
|
|
+ System.out.println(rs.getString("count"));
|
|
|
+ }
|
|
|
+ rs.close();
|
|
|
+ pst.close();
|
|
|
+ conn.close();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
String code = mrFacade.createMr(pushJoinVO);
|
|
|
String url =
|
|
|
return null;
|