27 lines
1.1 KiB
Java
27 lines
1.1 KiB
Java
import java.sql.Connection;
|
|
import java.sql.DriverManager;
|
|
import java.sql.ResultSet;
|
|
import java.sql.Statement;
|
|
|
|
public class TestDb {
|
|
public static void main(String[] args) {
|
|
try {
|
|
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/sisvietnam", "sisvietnam", "sisvietnam");
|
|
Statement stmt = conn.createStatement();
|
|
ResultSet rs = stmt.executeQuery("SELECT id, slug, html_template FROM sis_component_template");
|
|
while (rs.next()) {
|
|
System.out.println("--- ID: " + rs.getInt("id") + " SLUG: " + rs.getString("slug") + " ---");
|
|
String html = rs.getString("html_template");
|
|
if (html != null && html.contains("\\n")) {
|
|
System.out.println("CONTAINS LITERAL \\n!");
|
|
} else if (html != null && html.contains("\n")) {
|
|
System.out.println("Contains actual newlines.");
|
|
}
|
|
System.out.println(html);
|
|
}
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|