at java.lang.reflect.Constructor.newInstance(Constructor.java:513)是怎么回事
Exceptioninthread"main"com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolat...
Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1' for key 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2548)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1605)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1524)
at happyness.strandseq.produce(strandseq.java:77)
at happyness.strandseq.<init>(strandseq.java:25)
at happyness.strandseq.main(strandseq.java:261)
请问各位大侠,这是怎么回事啊,谢谢! 展开
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2548)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1605)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1524)
at happyness.strandseq.produce(strandseq.java:77)
at happyness.strandseq.<init>(strandseq.java:25)
at happyness.strandseq.main(strandseq.java:261)
请问各位大侠,这是怎么回事啊,谢谢! 展开
4个回答
展开全部
主键重复了.删除数据库中主键为1的记录,或者将插入的记录主键改掉.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
应该是主键重复了,看下是1的记录数据库中已经有了,还是你编写的时候出现了主键重复的问题
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
SQL语句错了。
你代码不写出来,怎么给你看具体问题?
主要看这句Duplicate entry '1' for key 1
检查一下这个文件strandseq
你代码不写出来,怎么给你看具体问题?
主要看这句Duplicate entry '1' for key 1
检查一下这个文件strandseq
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询