当前位置: 代码迷 >> Java Web开发 >> “The value for the useBean class attribute XXX is invalid” 如何解决
  详细解决方案

“The value for the useBean class attribute XXX is invalid” 如何解决

热度:675   发布时间:2016-04-17 15:27:30.0
“The value for the useBean class attribute XXX is invalid” 怎么解决?
bean  
package   beans;
import   java.sql.*;
public   class   connDB
{

Connection   conn=null;
Statement   stmt=null;
ResultSet   rs=null;
public   connDB()
{
try{
Class.forName( "com.microsoft.jdbc.sqlserver.SQLServerDriver ");
}
catch(java.lang.ClassNotFoundException   e)
{
System.err.println(e.getMessage());
}
}

public   ResultSet   executeQuery(String   sql)
{
try  
{
conn=DriverManager.getConnection( "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb;user=sa;password= ");
stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
rs=stmt.executeQuery(sql);
}
catch(SQLException   ex)
{
System.err.println(ex.getMessage());
}
return   rs;
}
public   int   executeUpdate(String   sql)
{
int   result=0;
try
{
conn=DriverManager.getConnection( "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb;user=sa;password= ");
stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
result=stmt.executeUpdate(sql);
}
catch(SQLException   ex)
{
//System.err.println(ex.getMessage());
result=0;
}
return   result;
}
}
一放在jsp中就提示出错,到底是那里错了呢?

------解决方案--------------------
類怎麽不大寫呢
不夠規範哦
  相关解决方案