用java访问数据库# Java - 爪哇娇娃
w*y
1 楼
因为我定义的table里面有些属性是UNIQUE的,所以往里插入数据的时候,遇到duplicate
insertion就会有error返回
java.sql.SQLException: ERROR: Cannot insert a duplicate key into unique index
protein_protname_key
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:94)
at org.postgresql.Connection.ExecSQL(Connection.java:398)
at org.postgresql.jdbc2.Statement.execute(Statement.java:130)
at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73)
at CaptionProcessor.writeFacts(Capt
insertion就会有error返回
java.sql.SQLException: ERROR: Cannot insert a duplicate key into unique index
protein_protname_key
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:94)
at org.postgresql.Connection.ExecSQL(Connection.java:398)
at org.postgresql.jdbc2.Statement.execute(Statement.java:130)
at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73)
at CaptionProcessor.writeFacts(Capt