修改插入
This commit is contained in:
@@ -42,12 +42,25 @@ public class SQLiteUtil {
|
||||
// 先初始化数据库
|
||||
//initDatabase();
|
||||
|
||||
String insertSQL = """
|
||||
/*String insertSQL = """
|
||||
INSERT OR REPLACE INTO lottery_results
|
||||
(issue,time, result, winner, gd1, gd2, sum1, sum2, glh_result)
|
||||
VALUES (?,?, ?, ?, ?, ?, ?, ?, ?)
|
||||
""";
|
||||
|
||||
""";*/
|
||||
String insertSQL = """
|
||||
INSERT INTO lottery_results
|
||||
(issue, time, result, winner, gd1, gd2, sum1, sum2, glh_result)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
ON CONFLICT(issue) DO UPDATE SET
|
||||
time = excluded.time,
|
||||
result = excluded.result,
|
||||
winner = excluded.winner,
|
||||
gd1 = excluded.gd1,
|
||||
gd2 = excluded.gd2,
|
||||
sum1 = excluded.sum1,
|
||||
sum2 = excluded.sum2,
|
||||
glh_result = excluded.glh_result
|
||||
""";
|
||||
Connection conn = null;
|
||||
PreparedStatement pstmt = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user