没有出错信息,一切正常,我也很奇怪,但是就是写不进表中,但是我用“查询分析器”把命令打进去是可以执行的(写入),这说明我的“sql”语句是对的。真的很奇怪!
解决方案 »
- 做网站的统计的时候怎样知道浏览者已经离开网站?
- 实现一个让用户自定义查询条件的查询用什么方法呢?
- 求助jsp发送邮件的问题?急等!!!!!!!!!!!!!
- jsq+sql server 2000问题???
- Lomboz 配置的问题:Default Ejb Plugin怎么配置?
- 100分求助关于文件下载的问题
- 求JasperReports与ireport的详细文档
- 怎样判断某天所属的星期的星期一和星期天对应的日期分别是什么?
- Applet与Servlet通信的奇怪问题
- 如何,差别,JSP本身的URL地址??
- 谁能举一个关于jsp+xml的例子呀?
- 如何实现,发送手机短信?(希望高手不吝赐教)。
A default ResultSet object is not updatable and has a cursor that moves forward only. Thus, you can iterate through it only once and only from the first row to the last row. It is possible to produce ResultSet objects that are scrollable and/or updatable. The following code fragment, in which con is a valid Connection object, illustrates how to make a result set that is scrollable and insensitive to updates by others, and that is updatable. See ResultSet fields for other options.
Statement stmt = con.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
// rs will be scrollable, will not show changes made by others,
// and will be updatable
看样子是你的url有问题!
------------------------------------------------------------------
字段名称 数据类型 NULL 描述
-----------------------------------------------------------------
留言id
iBbsID int No PK
自动生成,每次+1
------------------------------------------------------------------
主题
nvTitle Nvarchar(90) Yes 为主贴而设,回复贴 没内容
------------------------------------------------------------------
作者
ncAuthor Nchar(9) No References Key
引用UserInfo.ncUserID
----------------------------------------------------------------
回复数
iReply Int Yes Default(0)
---------------------------------------------------------------
发表时间
dtTime datatime No 系统函数Getdate()
------------------------------------------------------------
留言内容
nvData Nvarchar(1000) No
--------------------------------------------------------------
留言性质
ncProp Nchar(1) no 主贴是“1”,回复贴“0”
-------------------------------------------------------------------
回复留言id
iReID Int yes Null表示没有回复(对主贴而言)靠此连接留言与回复留言
-------------------------------------------------------------------
点击数
iClick Int yes Default(0)
对于数据库的insert、update、delete操作,应该用executeUpdate(sql);故,你需要在db.java中添加一方法,用于插入、删除、更新操作:
public void executeUpdate(String sql)
{
try
{
conn=DriverManager.getConnection(sConnStr);
Statement stmt=conn.createStatement();
stmt.executeQuery(sql);
}catch(SQLException sqle)
{
System.err.println("Error connectiong: "+sql);
}
}
试了没??搞定了就结账!还有疑问就继续提问,不要让问题悬而不决!!希望大家一起养成良好的论坛习惯!
我觉得可以试试cleverfish(一只鱼) 说的executeUpdate()
可能问题就在这。