关于数据库添加语句问题
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");
唉,我菜鸟,求高手解答啊
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");
唉,我菜鸟,求高手解答啊
...全文
相关推荐
DB Browser的使用
**增强数据操作能力**:支持常见的数据库操作,如查询、更新、插入和删除等,使开发者能够快速验证代码逻辑或调试数据问题。#### 三、如何添加DB Browser1.
HTML5 Web Database 数据库的SQL语句的使用方法
此操作通过事务进行,即在db.transaction内调用。3. 插入数据:使用INSERT INTO语句向表中添加数据。
数据库sql语句大全
例如: ``` CREATE DATABASE myDatabase; ```2. **删除数据库**:使用`DROP DATABASE db_name`语句可以删除现有的数据库。
Adminsystems Database Class-开源
文件名"asys_db"很可能是指Adminsystems Database Class的核心文件,包含了一系列用于数据库操作的方法和功能。
Android 完成数据库的升级,给旧表中添加字段并保持原有数据
```三、添加字段当你需要给旧表添加新字段时,需要在`onUpgrade()`方法中执行SQL语句。


其他
