import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; public class UpdateLivestreamTemplate2 { public static void main(String[] args) { try { Class.forName("oracle.jdbc.OracleDriver"); Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam"); // We append &autoplay=1 to the URL in the database so it's ready to play 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&autoplay=1"); updatePost.executeUpdate(); // 2. Update the template to use data-src instead of src. 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" + " \"{{title}}\"\n" + "
\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(); } } }