up (严重)修复空闲歌单bug

This commit is contained in:
Coloryr committed 2024-09-16 12:54:35 +08:00
1 parent 336438b980
commit 412d8028d3
5 files changed
+16 -12

No files matched your search

+6 -3
View File
@@ -310,10 +310,13 @@ public class DataSql {
if (connection.isReadOnly() || connection.isClosed()) {
init();
}
String arrayAsString = String.join(",", list);
PreparedStatement pstmt = connection.prepareStatement("INSERT INTO allmusic_list (sid) VALUES (?)");
pstmt.setString(1, arrayAsString);
pstmt.execute();
// 遍历 List<String> 并插入每个字符串
for (String str : list) {
pstmt.setString(1, str); // 设置参数
pstmt.addBatch(); // 添加到批处理
}
pstmt.executeBatch();
pstmt.close();
} catch (Exception e) {
e.printStackTrace();