我用Java实现串口通信,成功从指定接口读出了数据,现在有什么方法可以实现把读出来的数据写进数据库吗?直接在下面加sql语句好像不行
```java
private static void readHoldingRegistersTest(ModbusMaster master, int slaveId, int start, int len) {
String sql="";
try {
ReadHoldingRegistersRequest request = new ReadHoldingRegistersRequest(slaveId, start, len);
ReadHoldingRegistersResponse response = (ReadHoldingRegistersResponse)master.send(request);
if (response.isException()) {
System.out.println("Exception response: message=" + response.getExceptionMessage());
} else {
System.out.println("read success"+ Arrays.toString(response.getShortData()));
/*String TARGET_ANGLE = response.getShortData().toString();
Map<String,Object> param = new HashMap<>();
param.put("TARGET_ANGLE",TARGET_ANGLE);
sql = "update tracker_tracking set TARGET_ANGLE = :TARGET_ANGLE where COMMUNICATION_BOX_NAME='NCU1'";*/
short[] list = response.getShortData();
for (int i = 0; i < list.length; i++) {
System.out.println(list[i] + " hhhhhhh ");
}
}
} catch (ModbusTransportException e) {
e.printStackTrace();
}
}
```