我已经从毫秒转换了时间,现在我想用那个时间值创建一个 SQL 插入。我试过这个,但它不工作:
String INSERT_RECORD ="INSERT INTO PRAVIDLA (CAS,DEN,MIESTNOST,STAV) values(?,?,?,?)";
PreparedStatement pstmt = con.prepareStatement(INSERT_RECORD);
Calendar calendar1 = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
calendar1.setTimeInMillis(milli);
Time Cas2 = (Time) calendar1.getTime();
pstmt.setTime(1, Cas2);
pstmt.setInt(2, DEN);
pstmt.setString(3, MIESTNOST);
pstmt.setString(4, STAV);
pstmt.executeUpdate();
请问有什么建议吗?