jt2594838 commented on a change in pull request #31: Fix sonar
URL: https://github.com/apache/incubator-iotdb/pull/31#discussion_r251005026
 
 

 ##########
 File path: 
iotdb/src/main/java/org/apache/iotdb/db/postback/receiver/ServerServiceImpl.java
 ##########
 @@ -193,32 +203,30 @@ public String startReceiving(String md5OfSender, 
List<String> filePathSplit,
    * IoTDB through jdbc status = 1 : the schema file has not received 
completely.
    */
   @Override
-  public void getSchema(ByteBuffer schema, int status) throws TException {
-    FileOutputStream fos = null;
-    FileChannel channel = null;
+  public void getSchema(ByteBuffer schema, int status) {
+    FileOutputStream fos;
+    FileChannel channel;
     if (status == 0) {
-      Connection connection = null;
       Statement statement = null;
-      try {
+      try (Connection connection = 
DriverManager.getConnection("jdbc:iotdb://localhost:" +
+          config.rpcPort + "/", "root", "root")) {
 
 Review comment:
   If you intend to use the super-user, you may refer the account and password 
in IoTDBConstant.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to