关于数据库添加语句问题
Connection conn = DB.getconn();
String sql="insert into articles values (null,?,?,?,?,now(),?)";
PreparedStatement pstmt = DB.prepareStmt(conn, sql);
pstmt.setInt(1,"pid");
pstmt.setInt(2,"rootid");
pstmt.setString(3,"title");
pstmt.setString(4,"cont");
pstmt.setInt(5,0);
pstmt.excuteUpdate();
DB.close(pstmt);
DB.close(conn);
总是报这样的错误,
An error occurred at line: 16 in the jsp file: /replyDeal.jsp
Connection cannot be resolved to a type
13: String title=request.getParameter("title");
14: System.out.println("title");
15: String cont=request.getParameter("cont");
16: Connection conn = DB.getconn();
17: String sql="insert into articles values (null,?,?,?,?,now(),?)";
18: PreparedStatement pstmt = DB.prepareStmt(conn, sql);
19: pstmt.setInt(1,"pid");
An error occurred at line: 18 in the jsp file: /replyDeal.jsp
PreparedStatement cannot be resolved to a type
15: String cont=request.getParameter("cont");
16: Connection conn = DB.getconn();
17: String sql="insert into articles values (null,?,?,?,?,now(),?)";
18: PreparedStatement pstmt = DB.prepareStmt(conn, sql);
19: pstmt.setInt(1,"pid");
20: pstmt.setInt(2,"rootid");
21: pstmt.setString(3,"title");
唉,我菜鸟,求高手解答啊