困扰我3天的问题---建立新的用户记录出错

JIEK_ONE 2005-09-03 05:29:25
这个问题困扰我3天了 虽然知道错误是说我的生成新数据的时候数据库关键字语法错误,却不知道问题出在那里 在这里请大家帮帮忙
1 CMP生成了数据库 生成关键字的语句如下
/**
* @ejb.interface-method view-type = "both"
* @ejb.persistence column-name = "id"
* sql-type = "SERIAL"
* jdbc-type = "INTEGER"
* @ejb.pk-field
*
* @return
*/
我的数据库是mysql4.0 id字段在表里面的类型竟然是bigint 不知道这是为什么
2 下面3个函数分别是在(1)UserInfo.java (2)UserInfoHome.java (3)UserInfoLocalHome.java里面的create()方法
(1) public Integer ejbCreate() throws CreateException {
return null;
}

(2) public com.luojie.userinfo.entity.interfaces.UserInfo create()
throws javax.ejb.CreateException,java.rmi.RemoteException;

(3) public com.luojie.userinfo.entity.interfaces.UserInfoLocal create()
throws javax.ejb.CreateException;

3 此函数是我的sessionbean里面创建新记录 如下:
/**
* This methode create a new userinfo
*
* @ejb.interface-method view-type = "both"
*/
public void createNewUserInfo(String userName)throws EJBException, CreateException{
try{
InitialContext context = new InitialContext();
// Get the home interface with JNDI from the application server
UserInfoLocalHome userInfoLocalHome = (UserInfoLocalHome)context.lookup
(UserInfoLocalHome.JNDI_NAME);
UserInfoLocal userInfoLocal = userInfoLocalHome.create();
//userInfoLocal.setId(new Integer(0));
userInfoLocal.setUserName(userName);
}catch (NamingException e) {
System.out.println("this is createNewUserInfo's error "+ e.getMessage());
throw new EJBException(e.getMessage());
}
}
4 部署成功 生成webservice 在webservice有看到了createNewUserInfo方法 利用http://localhost:8080/axis/services/UserInfoSession?method=createNewUserInfo&username=ss
页面出现如下错误
org.jboss.tm.JBossTransactionRolledbackException: Error extracting generated keys; CausedByException is:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('userinfo_id_seq')' at line 1; CausedByException is:
Error extracting generated keys; CausedByException is:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('userinfo_id_seq')' at line 1; nested exception is:
javax.ejb.EJBException: Error extracting generated keys; CausedByException is:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('userinfo_id_seq')' at line 1; - nested throwable: (javax.ejb.EJBException: Error extracting generated keys; CausedByException is:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('userinfo_id_seq')' at line 1)
麻烦大家帮帮我 谢谢
...全文
141 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
王洲 2005-09-05
  • 打赏
  • 举报
回复
我也只能帮你顶一下了
JIEK_ONE 2005-09-05
  • 打赏
  • 举报
回复
我在顶下 希望有人可以看到
JIEK_ONE 2005-09-04
  • 打赏
  • 举报
回复
没有人告诉我吗?我难道的换BMP来做吗?
红酒咖啡 2005-09-03
  • 打赏
  • 举报
回复
不懂得MYSQL所以不会解说的,,,不过帮你顶一下的@!!
JIEK_ONE 2005-09-03
  • 打赏
  • 举报
回复
自己给自己顶下

67,550

社区成员

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

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