Home > Database > Mysql Tutorial > myeclipse 10.7中用jsp无法连接mysql 5.5 单独用java文件却可以~

myeclipse 10.7中用jsp无法连接mysql 5.5 单独用java文件却可以~

WBOY
Release: 2016-06-06 09:34:41
Original
1378 people have browsed it

mysqljsp数据库myeclipse

我是要做一个简单的查询数据库操作,在win10 64位系统用tomcat 7 myeclipse 10.7用jsp无法连接数据库,提示NO SUITBLE Driver和空指针
但是我换成win 7 32位系统用tomcat 6 myeclipse 8,5 时就可以查询了,两边的代码和操作都一样~~求大神赐教~!
select.jsp中出错代码段: Student student=new Student();
//创com.ch6.dal.Studne的对象,命名为student
List list=student.getList(); //该方法返回一个LIST集合(显示这里出错)
for(StudentInfo info:list){
%>
Student.java如下:public class Student {
Conn conn=new Conn();
/*获取学生列表*/
public List getList() throws SQLException{
List list=new ArrayList();
String sql="select * from student order by number asc";
ResultSet rs=conn.executeQuery(sql);

<code>    **while(rs.next()){//这里显示空指针**        StudentInfo info=new StudentInfo();        info.setId(rs.getInt("Id"));        info.setNumber(rs.getString("Number"));        info.setName(rs.getString("Name"));        info.setAddress(rs.getString("Address"));        info.setSex(rs.getString("Sex"));        info.setPhone(rs.getString("Phone"));        info.setEmail(rs.getString("Email"));        list.add(info);    }    conn.close();    return list;}</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template