⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lybpro.jsp.bak

📁 jsp开发的在线答疑系统
💻 BAK
字号:
<%@ page language = "java" contentType = "text/html;charset=gb2312"%>
<%@ page import = "java.sql.*" %>
<jsp:useBean id="lybP" scope="page" class="webchat.Msg"/>
<%! String trans(String chi)
{
               String result = null;
               byte temp [];
               try
                {
                      temp=chi.getBytes("iso-8859-1");
                      result = new String(temp, "gb2312");
                }
                catch(Exception e)
                {
                        System.out.println (e.toString());
                }
                return result;
}
%>
<%
	String strSQL1 = "select id from message order by id asc";
	ResultSet rs = subject.executeQuery(strSQL1);
	String MaxID = new String();
	int id = 0;
	while(rs.next())
	{
		id = rs.getInt("id");
	}
	/*int k = 0;
	for (k = 0; k < 999999; k++)
	{
 	  if (id.equals(MaxID.valueOf(k)))
		break;
	}
	++k;
	if (k >= 999999)
		k = 1;
	id = MaxID.valueOf(k);*/
	id++;
	System.out.println("id" + id);
rs.close();
%>
<%
String content = new String (request.getParameter("textarea"));
String tempname = new String();
String sql = "select stuname from student where stuid = '"+session.getValue("wnum")+"'";
ResultSet rs1=subject.executeQuery(sql);
	while (rs1.next())
{
	tempname =rs1.getString("username");
}

rs1.close();

%>
<%
	String sql2 = "insert into message( id, [from], content) values(" + id + ",'" + "','" + username + "','" + trans(content) + "')";
	subject.executeUpdate(sql2);
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta HTTP-EQUIV=REFRESH CONTENT="10; URL=luy.jsp">
<link href="chat.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
@import url("_notes/ccc");
body,td,th {
	font-size: 12px;
	color: #FFFFFF;
	font-weight: bold;
}
a:link {
	color: #000000;
}
-->
</style>
</HEAD>
<BODY BGCOLOR=#0D85A6 BACKGROUND="images/bgg.gif" >
<div align="center">
  <p align="left">

    <br>
  您所的意见已经被提交,谢谢您对我们的支持,本页将于10秒内自动<a href="Frameline.html">返回首页</a></p>

</div>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -