Results 1 to 5 of 5
Thread: Auto refresh in jsp..
- 04-23-2012, 12:26 PM #1
Member
- Join Date
- Apr 2012
- Posts
- 27
- Rep Power
- 0
Auto refresh in jsp..
How to auto refresh table inside JSP....
here is the code:-
Java Code:<%@ page import="java.sql.*" %> <% try{ String driver="sun.jdbc.odbc.JdbcOdbcDriver"; Class.forName(driver); String url="jdbc:odbc:trial"; Connection con=DriverManager.getConnection(url); Statement st=con.createStatement(); String sql=("SELECT * FROM signup"); ResultSet rs=st.executeQuery(sql); %> <html> <head> <title>admin page</title> </head> <center> <div STYLE="background:gray; font: 26pt/30pt courier; font-variant: small-caps; border: thick dashed blue 3px; border-radius:10px; margin-left:300px;margin-right:300px;"> <h2>you'r most welcome to admin page</h2> </div> </br> <h3><b>User Information</b></h3> <table border="1" height=50 width=350 style="border-radius:10px;"> <tr><td style="border-radius:10px;"><center>FIRSTNAME</center></td> <td style="border-radius:10px;"><center>LASTNAME<center></td> <td style="border-radius:10px;"><center>EMAIL<center></td> <td style="border-radius:10px;"><center>PASSWORDF<center></td> <td style="border-radius:10px;"><center>SECRETWORD<center></td></tr> <% while(rs.next()){ %> <tr><td><%=rs.getString("FIRSTNAME")%></td> <td><%=rs.getString("LASTNAME")%></td> <td><%=rs.getString("EMAIL")%></td> <td><%=rs.getString("PASSWORD")%></td> <td><%=rs.getString("SECRETWORD")%></td></tr> <% } %> <% }catch(Exception ex){} %> </table> </center> </html>
- 04-23-2012, 02:04 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: Auto refresh in jsp..
Use Javascript and Ajax calls to a servlet that provides the data to stick in the table?
That's how I'd do it anyway.Please do not ask for code as refusal often offends.
- 04-23-2012, 06:27 PM #3
Member
- Join Date
- Apr 2012
- Posts
- 27
- Rep Power
- 0
Re: Auto refresh in jsp..
Ok... but i dont know Ajax.. can you give me the code example to refresh it..?
- 04-23-2012, 06:31 PM #4
Re: Auto refresh in jsp..
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 04-24-2012, 09:30 AM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Similar Threads
-
Auto Refresh a Java Popup Page?
By lokerd in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 06-07-2011, 06:46 PM -
Auto contrast and auto brightness
By oxxxis in forum Java 2DReplies: 0Last Post: 01-21-2010, 08:32 PM -
JSP Auto Log -In
By Eku in forum JavaServer Pages (JSP) and JSTLReplies: 3Last Post: 09-18-2008, 03:58 AM -
Auto-complete/Auto-fix for custom statement
By dark_cybernetics in forum EclipseReplies: 0Last Post: 08-19-2008, 11:19 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks