Hi all!
Can anyone help me on finding out if it is possible to fill an iframe in a jsp loading text from MySQL? or a different way to do it?
Thanks in advance
Example:
<%
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
String entry1=null;
try {
String dbURL = "jdbc:mysql://localhost/data?";
String username = "root";
String password = "paulo";
String[] temp;
Class.forName("com.mysql.jdbc.Driver");
conn =
DriverManager.getConnection(dbURL, username, password);
stmt = conn.createStatement();
if (stmt.execute(" select *from version where textName='name'and versionName='2'")) {
rs = stmt.getResultSet();
rs.next();
entry1 = rs.getString(3);
} else {
System.err.println("select failed");
}
} catch (ClassNotFoundException ex) {
System.err.println("Failed to load mysql driver");
System.err.println(ex);
} catch (SQLException ex) {
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());
} finally {
if (rs != null) {
try {
rs.close();
} catch (SQLException ex) { /* ignore */ }
rs = null;
}
if (stmt != null) {
try {
stmt.close();
} catch (SQLException ex) { /* ignore */ }
stmt = null;
}
if (conn != null) {
try {
conn.close();
} catch (SQLException ex) { /* ignore */ }
conn = null;
}
}
%>
<iframe src =<%=entry1%> width = 100% height = 100%> </iframe>