java.sql.SQLException: ORA-00001: 违反唯一约束条件 (SCOTT.SYS_C0011456)

我tb_user数据库的主键是id,在这个java程序中:

String sql="insert into tb_user(id,USER_NAME,USER_PASSWORD) values(user_seq.nextval,‘"+un+"‘,‘"+pw+"‘)";

序列也是主键,创建序列时的初始值因为选用的默认值为1,而原来tb_user也有值

这个java异常即是主键重复了。

因此将修改序列的初始值改大一些,我的改为3即可。

时间: 2024-08-27 07:23:11

java.sql.SQLException: ORA-00001: 违反唯一约束条件 (SCOTT.SYS_C0011456)的相关文章

oracle数据库出现“批处理中出现错误: ORA-00001: 违反唯一约束条件”解决方法

最近使用oraclede impdp工具全库导入数据库时,在数据库里面使用出现如下情况. SQL state [null]; error code [17081]; 批处理中出现错误: ORA-00001: 违反唯一约束条件 (GDXAORCL.SYS_C0055359) ; nested exception is java.sql.BatchUpdateException: 批处理中出现错误: ORA-00001: 违反唯一约束条件 (GDXAORCL.SYS_C0055359) -(:155

java.sql.SQLException: Io 异常: Got minus one from a read call

博客分类: Oracle Tomcat服务器下的应用连接Oracle时报错,出现以下异常: java.sql.SQLException: Io 异常: Got minus one from a read call 查询数据库连接情况: Java代码   SQL> select username,count(username) from v$session where username is not null group by username; USERNAME                 

struts2+hibernate+spring简单整合且java.sql.SQLException: No suitable driver 问题解决

最近上j2ee的课,老师要求整合struts2+hibernate+spring,我自己其实早早地有准备弄的,现在都第9个项目了,无奈自己的思路和头绪把自己带坑了,当然也是经验问题,其实只是用myeclipse进行整合的,本来也没那么多问题,看视频吧居然好多要手打,我不喜欢看不下去放弃了,教程把就是一堆坑,最最让人不解的是明明有一个冲突是需要解决的,但我看到的教程居然都没有提到,还有一个错误居然好多人都好像自动忽略一样,能解决我问题的都是要漫长的找,所以我一定一定要把这个过程记录下来,给第一次搞

java.sql.SQLException: 无法从套接字读取更多的数据(mybatis 插入时)

今天  做mybatis 的批量插入的时候  出现 java.sql.SQLException: 无法从套接字读取更多的数据   的错误 解决方法: 由于批量插入的数据过大,需要分批次的插入. List<IdentificationData> insertList = new ArrayList<IdentificationData>(); for (IdentificationData domain : list) { insertList.add(domain); //批量插入

nested exception is java.sql.SQLException: IO 错误

1.错误描述 (mx.messaging.messages::ErrorMessage)#0 body = (null) clientId = "18CE3B03-9709-9DA8-7634-340C23317FDD" correlationId = "3161DF25-D056-D694-E5CF-963E4FE036D9" destination = "waitController" extendedData = (null) faultC

Cause: java.sql.SQLException: 无法转换为内部表示(Mybatis)

公司开发档案系统使用框架:Spring+Struts2+Mybatis+EasyUI,在开发过程中出现sql异常:“Cause: java.sql.SQLException: 无法转换为内部表示”,错误如下: org.springframework.jdbc.UncategorizedSQLException: ### Error querying database. Cause: java.sql.SQLException: 无法转换为内部表示 ### The error may involv

java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect

java.sql.SQLException: null, message from server: “Host ‘xxx’ is not allowed to connect 2014年06月29日 ⁄ 综合 ⁄ 共 637字 ⁄ 字号 小 中 大 ⁄ 评论关闭 java.sql.SQLException: null,  message from server: "Host 'xxx' is not allowed to connect to this MySQL server": j

java.sql.SQLException: Access denied for user &#39;jinxin&#39;@&#39;localhost&#39; (using password: YES)

用mybatis和spring整合时出现了一个错误: 我是在IntelliJ IDEA上整合Mybatis和Spring的,运行测试用例出现了如上错误. 红色的马赛克部分是我的名字,问题是,我的数据库里面没有以我名字为用户名的用户.而只有IntelliJIDEA是用我的名字授权的. 网上搜了很多类似的错误处理方法. java.sql.SQLException: Access denied for user 'jinxin'@'localhost' (using password: YES)

java.sql.SQLException: Can not issue empty query.

1.错误叙述性说明 java.sql.SQLException: Can not issue empty query. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java: