lih 4 năm trước cách đây
mục cha
commit
c020306a5b

+ 2 - 2
src/com/wecise/odb/Connector.java

@@ -52,10 +52,10 @@ public class Connector implements Runnable {
         return this.closed;
     }
 
-    public synchronized Message request(String uri, Object body) {
+    public synchronized Message request(String uri, String body) {
         HashMap<String, String> meta = new HashMap<>();
         meta.put("X-Accept-Body-Codec", "106");
-        Message sendmsg = new Message("", 1, uri, meta, 'j', new Gson().toJson(body));
+        Message sendmsg = new Message("", 1, uri, meta, 'j', body);
         Message recvmsg = null;
         try {
             OutputStream outputStream = socket.getOutputStream(); // 获取一个输出流,向服务端发送信息

+ 2 - 2
src/com/wecise/odb/jdbc/ODBDatabaseMetaData.java

@@ -628,7 +628,7 @@ public class ODBDatabaseMetaData implements DatabaseMetaData {
             body.put("tablename", tableNamePattern);
             body.put("type", type);
 
-            Message recvmsg = ctr.request("/odb/system/tables", body);
+            Message recvmsg = ctr.request("/odb/system/tables", new Gson().toJson(body));
             if (recvmsg == null) {
                 throw new SQLException(Error.unableConnectServer);
             }
@@ -744,7 +744,7 @@ public class ODBDatabaseMetaData implements DatabaseMetaData {
             body.put("tablename", tableNamePattern);
             body.put("column", columnNamePattern);
 
-            Message recvmsg = ctr.request("/odb/system/columns", body);
+            Message recvmsg = ctr.request("/odb/system/columns", new Gson().toJson(body));
             if (recvmsg == null) {
                 throw new SQLException(Error.unableConnectServer);
             }

+ 1 - 1
src/com/wecise/odb/jdbc/ODBStatement.java

@@ -33,7 +33,7 @@ public class ODBStatement implements Statement {
             if (values != null && values.length > 0) {
                 body.put("values", values);
             }
-            Message recvmsg = ctr.request("/data/mql/execute", body);
+            Message recvmsg = ctr.request("/data/mql/execute", new Gson().toJson(body));
             if (recvmsg == null) {
                 throw new SQLException(Error.unableConnectServer);
             }

+ 1 - 1
src/com/wecise/odb/test/Test.java

@@ -22,7 +22,7 @@ public class Test {
         System.out.println("Continue....");
 
         Statement stmt = conn.createStatement();
-        ResultSet rs = stmt.executeQuery("select id, name, host as h, vtime, day, severity, tags from /matrix/devops/alert limit 100");
+        ResultSet rs = stmt.executeQuery("select id, host, config, depot from /matrix/system/hostinfo limit 100");
         printResult(rs);
         rs.close();
         stmt.close();