Mercurial > hg > monetdb-java
comparison src/main/java/org/monetdb/mcl/net/MapiSocket.java @ 904:2d880f90be2a
Try to use reasonable defaults for ClientInfo
author | Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com> |
---|---|
date | Fri, 14 Jun 2024 16:50:27 +0200 (10 months ago) |
parents | 778959b2e0a4 |
children | a52bc2dcdb8c |
comparison
equal
deleted
inserted
replaced
903:778959b2e0a4 | 904:2d880f90be2a |
---|---|
500 // String binaryPart = parts.length > 7 ? parts[7] : null; | 500 // String binaryPart = parts.length > 7 ? parts[7] : null; |
501 | 501 |
502 if (parts.length > 9 && target.isClientInfo()) { | 502 if (parts.length > 9 && target.isClientInfo()) { |
503 clientInfo = new ClientInfo(); | 503 clientInfo = new ClientInfo(); |
504 try { | 504 try { |
505 clientInfo.set("ApplicationName", target.getClientApplication()); | 505 String clientApplication = target.getClientApplication(); |
506 clientInfo.set("ClientRemark", target.getClientRemark()); | 506 String clientRemark = target.getClientRemark(); |
507 if (!clientApplication.isEmpty()) | |
508 clientInfo.set("ApplicationName", clientApplication); | |
509 if (!clientRemark.isEmpty()) | |
510 clientInfo.set("ClientRemark", clientRemark); | |
507 } catch (SQLClientInfoException e) { | 511 } catch (SQLClientInfoException e) { |
508 String keys = String.join(", ", e.getFailedProperties().keySet()); | 512 String keys = String.join(", ", e.getFailedProperties().keySet()); |
509 throw new MCLException("Could not set ClientInfo properties: " + keys, e); | 513 throw new MCLException("Could not set ClientInfo properties: " + keys, e); |
510 } | 514 } |
511 } | 515 } |