日期:2014-05-18  浏览次数:20765 次

求救:javabean连接数据库
index.jsp   文件代码:

<%@   page   contentType= "text/html;   charset=gb2312 "   language= "java "   import= "java.sql.* "   errorPage= " "   %>
<html>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
<%@   page   import= "java.sql.* "   %>
<title> 查询字符串 </title>
</head>
<jsp:useBean   id= "connection "   scope= "request "   class= "com.JDBCconnection "/>

<%request.setCharacterEncoding( "gb2312 ");%>
<body>
<form   name= "form1 "   method= "post "   action= " ">
    <p> &nbsp; </p>
    <table   width= "711 "   height= "169 "   border= "1 "   align= "center "   cellpadding= "0 "   cellspacing= "0 "   bordercolor= "#6894D5 ">
        <tr>
            <td   width= "122 "   height= "32 "   bordercolor= "#6894D5 "   background= "Images/l_001.jpg "   bgcolor= "#FFFFFF "   scope= "col "> <div   align= "center "> 查询字符串&gt;&gt;&gt; </div> </td>
            <td   width= "583 "   background= "Images/001.jpg "   scope= "col "> <div   align= "center ">
                <p> 查询管理学院的学生信息&nbsp;   <a   href= "selectstring.jsp "> 查询 </a> </p>
            </div> </td>
        </tr>
        <tr>
            <td   height= "135 "   background= "Images/l_002.jpg "> &nbsp; </td>
            <td> <p> &nbsp; </p>             <table   width= "577 "   height= "52 "   border= "1 "   align= "center "   cellpadding= "0 "   cellspacing= "0 "   bordercolor= "#6894D5 ">
                <tr   bgcolor= "#A6DFFA ">
                    <td   width= "75 "   height= "27 "   scope= "col "> <div   align= "center "> 学号 </div> </td>
                    <td   width= "63 "   scope= "col "> <div   align= "center "> 姓名 </div> </td>
                    <td   width= "54 "   scope= "col "> <div   align= "center "> 年龄 </div> </td>
                    <td   width= "111 "   scope= "col "