springMVC 使用json出错java.sql.SQLException: Positioned Update not supported.

My_Super_Baby 2014-09-05 03:42:20

@Entity
@Table(name = "user")
public class User extends BaseDomain{

private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="id")
private Long id;

/**区域id**/
@Column(name="area_id",length=20)
private Long area_id;

@ManyToOne(cascade={CascadeType.REFRESH},fetch=FetchType.LAZY,optional=true)
@JoinColumn(name="area_id",referencedColumnName="id",insertable=false,nullable=true,updatable=false)
private Area area;

/**用户类型**/
@Column(name="user_type_id",length=20)
private Long user_type_id;

@ManyToOne(cascade={CascadeType.REFRESH},fetch=FetchType.LAZY,optional=true)
@JoinColumn(name="user_type_id",referencedColumnName="id",insertable=false,nullable=true,updatable=false)
private UserType userType;

/**姓名**/
@Column(name="name",length=20)
private String name;

/**密码**/
@Column(name="password",length=20)
private String password;

/**用户组**/
@Column(name="group_id",length=20)
private Long group_id;

@ManyToOne(cascade={CascadeType.REFRESH},fetch=FetchType.LAZY,optional=true)
@JoinColumn(name="group_id",referencedColumnName="id",insertable=false,nullable=true,updatable=false)
private Group group;

/**国家**/
@Column(name="country",length=20)
private String country;
/**城市**/
@Column(name="city",length=40)
private String city;
/**邮箱**/
@Column(name="email",length=50)
private String email;
/**电话**/
@Column(name="phone",length=20)
private String phone;

/**是否删除,N-->未删除,Y-->为逻辑删除**/
@Column(name="deleted",length=1)
private String deleted;

@Column(name="isActive",length=1)
private String isActive;

public String getIsActive() {
return isActive;
}
public void setIsActive(String isActive) {
this.isActive = isActive;
}
public String getDeleted() {
return deleted;
}
public void setDeleted(String deleted) {
this.deleted = deleted;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}

public Long getArea_id() {
return area_id;
}
public void setArea_id(Long area_id) {
this.area_id = area_id;
}

public Area getArea() {
return area;
}
public void setArea(Area area) {
this.area = area;
}

public Long getUser_type_id() {
return user_type_id;
}
public void setUser_type_id(Long user_type_id) {
this.user_type_id = user_type_id;
}
public UserType getUserType() {
return userType;
}
public void setUserType(UserType userType) {
this.userType = userType;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getGroup_id() {
return group_id;
}
public void setGroup_id(Long group_id) {
this.group_id = group_id;
}
public Group getGroup() {
return group;
}
public void setGroup(Group group) {
this.group = group;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}


controll处理
Map<String, Object> map =new HashMap<String, Object>();
int intPage = Integer.parseInt((page == null || page == "0") ? "1":page);
List<User> users =this.userService.getNewUsersByPagenation(rows, intPage);
List<User> all =this.userService.getAllNewUser();
map.put("total", all.size());
map.put("rows", users);
return JSONObject.fromObject(map).toString();

报错提示:
java.sql.SQLException: Positioned Update not supported.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
at com.mysql.jdbc.ResultSetImpl.getCursorName(ResultSetImpl.java:2093)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:2155)
at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1323)
at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:762)
at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:837)
at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:426)
at net.sf.json.JSONObject._fromBean(JSONObject.java:928)
at net.sf.json.JSONObject.fromObject(JSONObject.java:192)
at net.sf.json.JSONObject._processValue(JSONObject.java:2774)
at net.sf.json.JSONObject._setInternal(JSONObject.java:2798)
at net.sf.json.JSONObject.setValue(JSONObject.java:1507)
at net.sf.json.JSONObject._fromBean(JSONObject.java:940)
at net.sf.json.JSONObject.fromObject(JSONObject.java:192)
at net.sf.json.JSONObject._processValue(JSONObject.java:2774)
at net.sf.json.JSONObject._setInternal(JSONObject.java:2798)
at net.sf.json.JSONObject.setValue(JSONObject.java:1507)
at net.sf.json.JSONObject._fromBean(JSONObject.java:940)
at net.sf.json.JSONObject.fromObject(JSONObject.java:192)
at net.sf.json.JSONObject._processValue(JSONObject.java:2774)
at net.sf.json.JSONObject._setInternal(JSONObject.java:2798)
at net.sf.json.JSONObject.setValue(JSONObject.java:1507)
at net.sf.json.JSONObject._fromBean(JSONObject.java:940)
at net.sf.json.JSONObject.fromObject(JSONObject.java:192)
at net.sf.json.JSONObject._processValue(JSONObject.java:2774)
at net.sf.json.JSONObject._setInternal(JSONObject.java:2798)
at net.sf.json.JSONObject.setValue(JSONObject.java:1507)
at net.sf.json.JSONObject._fromBean(JSONObject.java:940)
at net.sf.json.JSONObject.fromObject(JSONObject.java:192)
at net.sf.json.JSONObject._processValue(JSONObject.java:2774)
at net.sf.json.JSONObject._setInternal(JSONObject.java:2798)
at net.sf.json.JSONObject.setValue(JSONObject.java:1507)
at net.sf.json.JSONObject._fromBean(JSONObject.java:940)
at net.sf.json.JSONObject.fromObject(JSONObject.java:192)
at net.sf.json.JSONObject._processValue(JSONObject.java:2774)
at net.sf.json.JSONObject._setInternal(JSONObject.java:2798)
at net.sf.json.JSONObject.setValue(JSONObject.java:1507)
at net.sf.json.JSONObject._fromBean(JSONObject.java:940)
at net.sf.json.JSONObject.fromObject(JSONObject.java:192)
at net.sf.json.JSONObject._processValue(JSONObject.java:2774)
at net.sf.json.JSONObject._setInternal(JSONObject.java:2798)
at net.sf.json.JSONObject.setValue(JSONObject.java:1507)
at net.sf.json.JSONObject._fromBean(JSONObject.java:940)
at net.sf.json.JSONObject.fromObject(JSONObject.java:192)
at net.sf.json.JSONObject._processValue(JSONObject.java:2774)
at net.sf.json.JSONObject._setInternal(JSONObject.java:2798)
at net.sf.json.JSONObject.setValue(JSONObject.java:1507)
at net.sf.json.JSONObject._fromBean(JSONObject.java:940)
at net.sf.json.JSONObject.fromObject(JSONObject.java:192)
at net.sf.json.JSONArray._processValue(JSONArray.java:2557)
at net.sf.json.JSONArray.processValue(JSONArray.java:2588)
at net.sf.json.JSONArray.addValue(JSONArray.java:2575)
at net.sf.json.JSONArray._fromCollection(JSONArray.java:1082)
at net.sf.json.JSONArray.fromObject(JSONArray.java:145)
at net.sf.json.JSONObject._processValue(JSONObject.java:2749)
at net.sf.json.JSONObject._setInternal(JSONObject.java:2798)
at net.sf.json.JSONObject.setValue(JSONObject.java:1507)
at net.sf.json.JSONObject._fromMap(JSONObject.java:1284)
at net.sf.json.JSONObject.fromObject(JSONObject.java:183)
at net.sf.json.JSONObject.fromObject(JSONObject.java:154)
at upload.controller.UserController.getNewUser(UserController.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
...全文
2954 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
你这样转不会有问题么?

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧