import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; public class UpdateLivestreamTemplate5 { public static void main(String[] args) { try { Class.forName("oracle.jdbc.OracleDriver"); Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam"); // Revert the URL in the database to exactly what the user requested, without autoplay PreparedStatement updatePost = conn.prepareStatement( "UPDATE sis_post SET meta_description = ? WHERE slug = 'sis-vi-suc-khoe-cong-dong-ky-134'" ); updatePost.setString(1, "https://www.youtube.com/embed/j63kT9Bjrb4?si=N5JwIcuRn-iRxkYu"); updatePost.executeUpdate(); // We remove the custom image and play button entirely and let YouTube handle it! String htmlTemplate = "\n" + "
\n" + "
\n" + "
\n" + "
\n" + "

LiveStream

\n" + "
\n" + "
\n" + "
\n" + "
\n" + " {{#each livestream_posts}}\n" + " {{title}}\n" + " {{/each}}\n" + "
\n" + "
\n" + "
\n" + " {{#each livestream_posts}}\n" + "
\n" + "
\n" + "

{{excerpt}}

\n" + "
\n" + "
\n" + "
{{content}}
\n" + "
\n" + "
\n" + " \n" + "
\n" + "
\n" + " {{/each}}\n" + "
\n" + "
\n" + "
\n" + "
\n" + " {{#each livestream_posts}}\n" + "
\n" + "
\n" + " \n" + "
\n" + "
\n" + " {{/each}}\n" + "
\n" + "
\n" + "
\n" + ""; PreparedStatement updateTemplate = conn.prepareStatement( "UPDATE sis_component_template SET html_template = ? WHERE slug = 'tabbed-livestream'" ); updateTemplate.setString(1, htmlTemplate); updateTemplate.executeUpdate(); System.out.println("Update complete!"); conn.close(); } catch (Exception e) { e.printStackTrace(); } } }