954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Fill iframe loading text from mysql database

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>
softDeveloper
Junior Poster in Training
67 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: