|
|
|

<%!
Connection con;
PreparedStatement pstmt,pstmt1,pstmt2;
ResultSet rs,rs1;
String name,email,query,brief;
int i,msgid,count,counti,countj,j,k;
%>
<%
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:nami","","");
count = Integer.parseInt(request.getParameter("count"));
counti = count+9;
countj = 0;
//System.out.println("Count : "+count);
%>
<%
pstmt = con.prepareStatement("select * from msgboard");
rs=pstmt.executeQuery();
i=0;
j=0;
while(rs.next())
{
i++;
if(i>=count&&i<=counti)
{
j++;
msgid=rs.getInt(1);
name=rs.getString(2);
query=rs.getString(3);
pstmt1 = con.prepareStatement("select * from msgboard1 where msgid=?");
pstmt1.setInt(1,msgid);
rs1=pstmt1.executeQuery();
k=0;
while(rs1.next())
{
k++;
}
%>
<%= i %>. |
<%= query %> (<%= k %>)
ID - <%= msgid %> By
<%= name %>
|
<%
}
}
count = count+10;
%>
|
<%
if(count>=16)
{
%>
<%
}
%>
|
Total
messages - <%= i %>
|
<%
if(j==10)
{
%>
<%
}
%>
|
<%
}
catch(Exception e)
{
//System.out.println("Error : "+e.getMessage());
}
%>
|
|
|