Files
sisvietnamvn_01/sisvietnamvn_main/UpdateLivestreamPost.java
T

41 lines
2.5 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class UpdateLivestreamPost {
public static void main(String[] args) {
try {
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
String postTitle = "Tuần 1";
String postExcerpt = "SIS Vì Sức khỏe Cộng đồng kỳ 134 Thoát vị đĩa đệm Khi nào mới phẫu thuật?";
String postContent = "Đau lưng, đau cổ, tê tay, tê chân... là những triệu chứng thường gặp của thoát vị đĩa đệm. Tuy nhiên, không phải ai mắc bệnh cũng cần phẫu thuật.\n" +
"⚠️ Vậy khi nào nên điều trị bảo tồn? Khi nào cần phẫu thuật? Làm sao để tránh bỏ lỡ \"thời điểm vàng\" điều trị?\n" +
"Cùng lắng nghe những chia sẻ từ các chuyên gia trong chương trình Livestream \"S.I.S vì sức khỏe cộng đồng\" vào lúc 𝟏𝟗𝐡𝟒𝟓 Thứ Ba, ngày 𝟎𝟕/𝟎𝟕/𝟐𝟎𝟐𝟔.\n" +
"📌 Đồng hành và tư vấn trực tiếp cùng quý khán giả là các bác sĩ giàu kinh nghiệm tại Bệnh viện ĐKQT S.I.S Cần Thơ:\n" +
"• BS.CKI Nguyễn Quang Hưng, chuyên khoa Ngoại Thần kinh\n" +
"• BS.CKI Trương Đan Kha, chuyên khoa Vật lý trị liệu - Phục hồi chức năng \n" +
"• ThS.BS Lê Thị Chi Lan, chuyên khoa Ngoại Thần kinh.";
String embedUrl = "https://www.youtube.com/embed/j63kT9Bjrb4";
PreparedStatement updatePost = conn.prepareStatement(
"UPDATE sis_post SET title = ?, content = ?, excerpt = ?, meta_description = ?, featured_image = ? WHERE slug = 'sis-vi-suc-khoe-cong-dong-ky-134'"
);
updatePost.setString(1, postTitle);
updatePost.setString(2, postContent);
updatePost.setString(3, postExcerpt);
updatePost.setString(4, embedUrl);
updatePost.setString(5, "/uploads/livestream/livestream_tuan1.jpg");
int rows = updatePost.executeUpdate();
System.out.println("Updated rows: " + rows);
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}