想把下拉选单传送给mysql但是一值报错请大神帮忙解决====================================String Channel = request.getParameter(“Channel”);String WEEkDate = request.getParameter(“WeekDate”);String [] hobby = request.getRequestDispatcher(Channel,WEEkDate);<<<这里错误=================================================想询问一下要怎样才能接收String Channel follow String WEEkDate让 hobby接收下面是 jsp 上的代碼 ======================================<form method="post" action="vfvf.jsp"> <table width=500 align=center> <tr><td align = center>商家:<select name =“Channel”><option value =“上海商家”>上海商家<option value =“京东网店”>京东网店<td align = center>周: <select name="WeekDate"> <option value="0304">0304 <option value="0305">0305 <option value="0401">0401 <option value="0403">0403 </select> <input type="submit" value="ok"> </table> </form> <hr> <% request.setCharacterEncoding("utf-8"); String Channel = request.getParameter("Channel") ; String WEEkDate = request.getParameter("WeekDate") ; String[] hobby = request.getRequestDispatcher(Channel,WEEkDate); <<<这里错误 ResultSet rs = Songlist1.ktvChannelWeekDate(Channel ,WEEkDate);================================================
java接收内容
==========================
public static ResultSet ktvChannelWeekDate(String Channel,String WEEkDate)
{
String url="jdbc:mysql://localhost:3306/billboard?useUnicode=true&characterEncoding=utf-8";
String user="root";
String password="1234";
String sql="select * from ktvview where Channel='"+Channel+"'amd WeekDate='"+WEEkDate+"' order by id";ResultSet rs=null;
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection conn=DriverManager.getConnection(url, user, password);
Statement st=conn.createStatement();rs=st.executeQuery(sql);
} catch (ClassNotFoundException ex) {
System.out.println("no driver");
}catch(SQLException e)
{
System.out.println("no connection");
}
return rs;
}
添加回答
举报
0/150
提交
取消