请帮帮忙,很急(50分)

  • 主题发起人 丛艳全
  • 开始时间

丛艳全

Unregistered / Unconfirmed
GUEST, unregistred user!
<%@ page contentType=&quot;text/html;
charset=gb2312&quot;
language=&quot;java&quot;
import=&quot;java.sql.*&quot;
errorPage=&quot;&quot;
%>
<%@ page import=&quot;java.sql.*&quot;%>
<%!String t,m=null,q,ss;%>
<%!int s;%>
<%!ResultSet rs;%>
<html>
<head>
<meta http-equiv=&quot;Content-Type&quot;
content=&quot;text/html;
charset=gb2312&quot;>
<META HTTP-EQUIV=&quot;refresh&quot;
CONTENT=&quot;10&quot;/>
<title>无标题文档</title>
<style type=&quot;text/css&quot;>
<!--
.header {font-family: Tahoma, Verdana;
font-size: 9pt;
color: #FFFFFF;
background-color: #69C37C
}
.style1 {color: #FF0000}
.style6 {color: #666666}
body {
background-color: #D2FFFF;
}
-->
</style>
</head>
<body>
<p>
<%
Connection conn;
Statement stmt;
String sql;

m=request.getParameter(&quot;weihao1&quot;);
if(m==null){
m=&quot;&quot;;
}
Class.forName(&quot;sun.jdbc.odbc.JdbcOdbcDriver&quot;);
conn=DriverManager.getConnection(&quot;jdbc:eek:dbc:login&quot;,&quot;sa&quot;,&quot;sa&quot;);
stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);

sql=&quot;select * from edu where Education like '%&quot;+m+&quot;%'&quot;;
rs=stmt.executeQuery(sql);
if (rs.next())
{
ss =rs.getString(&quot;Education&quot;);
}
%>
</p>
<table style=&quot;BORDER-COLLAPSE: collapse&quot;
borderColor=#808080 cellPadding=5 width=&quot;242&quot;
border=1>
<tr>
<td>
<table width=100% border=0 align=&quot;center&quot;>
<tr>
<td align=&quot;center&quot;
class=&quot;header&quot;
colspan=2>位号实时状态</td>
</tr>
<tr>
<td width=&quot;36%&quot;
align=&quot;right&quot;><span class=&quot;style6&quot;>位号1:</span></td>
<td width=&quot;64%&quot;><%=ss%></td>
</tr>
<tr>
<td align=&quot;center&quot;
colspan=2>
<form name=&quot;form1&quot;
method=&quot;post&quot;
action=&quot;sm.jsp&quot;>
<input type=&quot;submit&quot;
name=&quot;Submit&quot;
value=&quot;返回&quot;>
</form></td>
</tr>
</table></td>
</tr>
</table>
<p> </p>
<p>

</p>
</body>
</html>
帮帮忙啊
看一看那个条语句错了啊
为什么不走这条语句:sql=&quot;select * from edu where Education like '%&quot;+m+&quot;%'&quot;;
 
D

delphisuccess

Unregistered / Unconfirmed
GUEST, unregistred user!
sql=&quot;select * from edu where Education like '%&quot;+m+&quot;%'&quot;;
rs=stmt.executeQuery(sql);將其改成:
rs=stmt.executeQuery(&quot;select * from edu where Education like '%&quot;+m+&quot;%'&quot;);
這樣看能執行嗎?
 

丛艳全

Unregistered / Unconfirmed
GUEST, unregistred user!
各位高手,帮帮忙啊
 
Y

yangxiao_jiang

Unregistered / Unconfirmed
GUEST, unregistred user!
服务器上的日志有什么错误。
页面没有错误?
把sql打印出来,看看sql语句是否错误。
 

Similar threads

I
回复
0
查看
667
import
I
I
回复
0
查看
2K
import
I
I
回复
0
查看
2K
import
I
I
回复
0
查看
1K
import
I
顶部