哪里出错了啊,类已经定义了啊
<%@ page contentType="text/html;charset=gb2312" import="java.sql.*"%><jsp:useBean id="db" class="dbBean.DBBean"(提示这里出错了) scope="session"/>
<%
request.setCharacterEncoding("gb2312");
String additem=request.getParameter("additem");
if(additem!=null)
{
String sql="insert into vote(item,count) values('"+additem+"',"+0+")";
db.executeUpdate(sql);
db.close();
}
%>
<jsp:forward page="manage.jsp"/>
下面是类的定义
package dbBean;
import java.sql.*;
public class DBBean
{
private String driverStr = "sun.jdbc.odbc.JdbcOdbcDriver";
private String connStr = "jdbc:odbc:vote";
private Connection conn = null;
private Statement stmt = null;
public DBBean()
{
try {
Class.forName(driverStr);
}
catch(ClassNotFoundException ex) {
System.out.println(ex.getMessage());
}
}
public void setDriverStr(String dstr)
{
driverStr=dstr;
}
public void setConnStr(String cstr)
{
connStr=cstr;
}
public ResultSet executeQuery(String sql)
{
ResultSet rs = null;
try {
conn = DriverManager.getConnection(connStr);
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
}
catch(SQLException ex) {
System.out.println(ex.getMessage());
}
return rs;
}
public int executeUpdate(String sql)
{
int result=0;
try{
conn = DriverManager.getConnection(connStr);
stmt = conn.createStatement();
result = stmt.executeUpdate(sql);
}
catch(SQLException ex){
System.out.println(ex.getMessage());
}
return result;
}
public void close()
{
try{
stmt.close();
conn.close();
}
catch(SQLException ex){
System.out.println(ex.getMessage());
}
}
}
--------------------编程问答-------------------- 报的啥子错误呢 --------------------编程问答-------------------- 错误信息呢? --------------------编程问答-------------------- <jsp:useBean id="db" class="dbBean.*"(提示这里出错了) scope="session"/> --------------------编程问答-------------------- 控制台报的错误吗?还是jsp里报编译错误? --------------------编程问答-------------------- 错误信息呢?
补充:Java , Web 开发