Sqlserver中的表更新不了
Sqlserver中的表更新不了,我有一个threads表,
里面有回复数,标题什么的再程序中做,更新
不了数据库,在数据库人为的可以更新。
不知道什么原因,跟表之间的关系有关吗?
大侠们,帮帮忙啊???
感觉程序没错的。
public int modifyThreads(Threads threads) {
int num=0;
String sql="update threads set fid=?,author=?,authorid=?,subject=?,dateline=?,lastPost=?,lastPoster=?,views=?,replies=?,displayOrder=?,highLight=?,digest=?,attachment=?,moderated=? where tid="+threads.getTid();
this.openConn();
try {
pstmt=conn.prepareStatement(sql);
pstmt.setInt(1,threads.getFid());
pstmt.setString(2, threads.getAuthor());
pstmt.setInt(3, threads.getAuthorid());
pstmt.setString(4,threads.getSubject());
System.out.println(threads.getSubject());
pstmt.setString(5,threads.getDateline().toString());
pstmt.setString(6,threads.getLastPost().toString());
pstmt.setString(7,threads.getLastPoster());
pstmt.setInt(8,threads.getViews());
pstmt.setInt(9,threads.getReplies());
pstmt.setByte(10,threads.getDisplayOrder());
pstmt.setByte(11,threads.getHighLight());
pstmt.setByte(12,threads.getDigest());
pstmt.setByte(13,threads.getAttachment());
pstmt.setByte(14,threads.getModerated());
num=pstmt.executeUpdate();
} catch (SQLException e) {
相关问答:
sqlserver,如果加个用户,权限是读所有表,但只能修改某个表的字段属性
没这个说法.
只给SELECT ,
UPDATE的只给某些表
个不会
但只能修改某个表的字段属性 这个难搞
要加权限得针对某个数据库
......
大家有没有 存储过程分页的例子,共享一下,谢谢!!!
http://wyf.javaeye.com/blog/462396
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
/*--实现分页的通用存储过程
......
需要使用SQL Server2000或2005
需要设计数据有效验证,防止录入不合法数据
需要设计存储过程或自定义函数完成数据的录入\修改\删除\统计\查询
数据库大部分表我已经建立,只是辅助性的小表建立的还不全
......
我看了很多文章,写的太专业,能不能用大白话讲讲,就是怎么构建索引的,查的时候是怎么样的步骤,为什么比like快,是不是只要用contect,就一定会去查,比如
select * from table where contect('sdfsd',sdf) and ......