应该是你的代码有问题
到Tomcat\work\Standalone\localhost
找你的reading_jsp.java
看看93行

解决方案 »

  1.   

    可是其他有数据库操作的页面错误提示都是一样的,没有数据库操作的就能正常显示啊
    而且Tomcat5.0窗口都是显示下面一行提示:
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
    我真不知怎么弄啊
      

  2.   

    我把我的数据库连接发上来,大家再看看,谢谢
    //DBConnectionBean.java
    //用在jsp网页里的数据库桥接bean
    package examinline;
    import java.util.*;
    import java.sql.*;
    import java.io.*;public class DBConnectionBean{
    Connection dbcon=null;
    Statement stmt=null;
    ResultSet result=null;
    String driver="";
    String url="";
    String user="";
    String password=""; public DBConnectionBean(){
    try{
    InputStream fis =getClass().getResourceAsStream("jdbcsql.properties");
    Properties  ps=new Properties();
    ps.load(fis);
    driver=ps.getProperty("driver");
    url=ps.getProperty("url");
    user=ps.getProperty("username");
    password=ps.getProperty("password");
    Class.forName(this.driver);
    }
    catch(Exception e){
    System.out.println(e);
    }
    }
    public void setdrivername()
    {
    try{
    Class.forName(this.driver);
    System.out.println("加载数据驱动成功!");
    }catch(ClassNotFoundException e){
    System.out.println("jdbc driver error");
               }
    }
    public Connection getopenConnection(){ try{
    this.dbcon=DriverManager.getConnection(this.url,this.user,this.password);
    System.out.println("桥接数据库成功!");
    }catch(SQLException e2){
    System.out.println(e2);
    }
    return dbcon;
    }
    public ResultSet executeQuery(String query)throws SQLException{
    this.stmt=dbcon.createStatement();
    this.result=stmt.executeQuery(query);
    return result;
    } public void executeUpdate(String query)throws SQLException{
    this.stmt=dbcon.createStatement();
    stmt.executeUpdate(query);
    if(stmt!=null) stmt.close();
    }
    public String getData(int index) throws SQLException{
    return result.getString(index);
    }
    public int getIntData(int index) throws SQLException{
    return result.getInt(index);
    }
    public float getFltData(int index) throws SQLException{
    return result.getFloat(index);
    }
    public boolean next() throws SQLException{
    return result.next();
    }
    public void resetResult() throws SQLException{
    this.result=null;
    }
    public void close() throws SQLException{
    if(dbcon!=null) dbcon.close();
    if(stmt!=null) stmt.close();
    if(result!=null) result.close();
    }
    public void finalize() throws Throwable{
    this.close();
    }
    public String replaceString(String str){ char tempArray[]=str.toCharArray(); int iCurr[]=new int[10]; int j=0; for(int i=0;i!=tempArray.length;i++)
    {
    int temp=(int)tempArray[i];
    if(temp==92){
    iCurr[j]=i;
    j++; }
    } final int temp2=j+1; String strArray[]=new String[temp2];
    strArray[0]=str.substring(0,iCurr[0]);
    strArray[temp2-1]=str.substring(iCurr[j-1]+1); for(int m=1;m!=strArray.length-1;m++){
    strArray[m]=str.substring(iCurr[m-1]+1,iCurr[m]);
    }
    str="";
    for(int k=0;k!=strArray.length-1;k++){
    str=str+strArray[k]+"%5C";
    }
    str=str+strArray[temp2-1];
    return str;
    }}
    配置文件为
    driver=com.microsoft.jdbc.sqlserver.SQLServerDriver
    url=jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=exam
    username=sa
    password=751020
    帮忙看下哪有问题没有