兄弟,id是sqlserver的关键字,把数据库表的这个字段改改试试看

解决方案 »

  1.   

    没人接分,那只要帮我看看这个函数写对了没有protected  Integer  get_id(String  tableName)  throws  SQLException  {  
           /*设置员工编号(查找表中最大编号,如果表中记录为空,则返回编号  1  
               否则返回最大编号+1)*/  
           Connection  con  =  null;  
           PreparedStatement  stmt  =  null;  
           ResultSet  rs  =  null;  
           try  {  
               con  =  BMPHelper.getConnection("MyCARD");  
               stmt  =  con.prepareStatement("SELECT  max(id)  from  "  +  tableName);  
               rs  =  stmt.executeQuery();  
               if  (  rs.next())  {  
                   return  new  Integer(rs.getInt("id")  +  this.min_id  );  
               }  
               else  {  
                   return    new  Integer(1);  
               }  
           }  
           finally  {  
               BMPHelper.cleanup(stmt,  con);  
           }  
       }
      

  2.   

    前5位回话者有分(只要你的回答是关于ejb的开发,一定要是自己写过的ejb程序)
      

  3.   

    get_id方法好象没有catch部分,其他看不出什么问题!
      

  4.   

    我们设计数据库时最好不要用到数据库的关键字,它在语法里会显示错误,你用SQL Server的查询分析器写上你的Insert into work (id....)....看看,是否正确