在daoimple中写了一个selectCourse方法用于向数据库中插入数据,我确定已经给用户分配好插入的权限了,我在一个单独的main函数中测试的时候是能插入进去的,但是在action中插入数据的时候却报了没有权限的异常。
main函数相关代码
String source = "applicationContext_student.xml";
ApplicationContext ac = new ClassPathXmlApplicationContext(source);
StudentService studentService = (StudentService) ac.getBean("studentService");
Result result = new Result();
然后是一系列set方法设置属性值
studentService.selectCourse(result);
这样是能插入进去数据库的,但是到了action中执行this.studentService.selectCourse(result);的时候报了没有权限的异常
十一月 20, 2016 3:38:59 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: 拒绝了对对象 'Result' (数据库 'Course_Selection_Management_System',架构 'dbo')的 INSERT 权限。
十一月 20, 2016 3:38:59 下午 org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl release
INFO: HHH000010: On release of batch it still contained JDBC statements
请问各位大神是为什么呢该怎么解决
关于javaweb中hibernate插入数据的问题
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-