| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1209 人关注过本帖
标题:请求帮助 为什么出错
只看楼主 加入收藏
eyudahui
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2008-10-22
收藏
 问题点数:0 回复次数:0 
请求帮助 为什么出错
我的代码如下
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Css/Css.css" rel="stylesheet" type="text/css">
<jsp:useBean id="connection" scope="request" class="default package.JDBConnection"/>
<title>把数据库中的记录显示到下拉列表中</title>
</head>
<%!
    private String strMDB = "LiteratureDate";
    private String[] strkey = {"Author","Title","Keywords","Abstract"};//篇名,作者,摘要,关键字
    private String[] strfield=  {"ID","Name","Author","Title","Journal","Style12","Pages","Volume","Keywords","Year","Date","Accession Number","Abstract","Notes","URL","Link to PDF","Author Address","Image"};
%>
<body>
    <form name = "form1" method = "post">
        <select name="key">
<%
            for(int i = 0 ; i < strkey.length ; ++i){
%>
                <option value=<%=strkey[i]%>><%=strkey[i]%></option>
<%
            }
%>
        </select>
        <input type = "text" name = "keyword" />
        <input type = "submit" value = "查询" />
        <table width="100%" border="1">
            <tr>
<%
                for(int i = 0 ; i < strfield.length; ++i){
%>
                    <td><b><%= strfield[i]%></b></td>

<%
                }
 %>
            </tr>
<%
      if(request.getParameter("keyword")!=null){
          String sql=null;
          ResultSet rs=null;

          sql="select * from Sheet1 where "+request.getParameter("key")+"='"+request.getParameter("keyword")+"'";
          rs=connection.executeQuery(sql);
          try{
              while(rs.next()){
%>
                <tr>
<%
                for(int i = 0 ; i < strfield.length; ++i){
%>
                    <td><TEXTAREA cols="50" rows="5"><%=rs.getString(strfield[i])%></TEXTAREA></td>
<%
                }
 %>
            </tr>
<%
              }
          }
          catch(Exception e){System.out.print(e.getMessage());}
      }
%>
    </table>
   </form>
</body>
</html>
报错是
Multiple annotations found at this line:
    - Syntax error on tokens, GenericType expected instead
    - Syntax error on tokens, Name expected instead
搜索更多相关主题的帖子: 请求 
2008-10-25 13:54
快速回复:请求帮助 为什么出错
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016520 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved