nosql - Non idempotent SQL command with OrientDB JDBC Driver -
hello, i'm facing issue while using jdbc driver connect plocal orient db. here code:
properties info = new properties(); info.put("user", this.user); info.put("password", this.pwd); java.sql.drivermanager.registerdriver(new com.orientechnologies.orient.jdbc.orientjdbcdriver()); connection conn = (orientjdbcconnection) drivermanager.getconnection(this.url, info); string sql = "insert personne (name) values(?)"; preparedstatement stmt = conn.preparestatement(sql); stmt.setstring(1, "test recuperation rid par jdbc"); resultset rs = stmt.executequery(); ...
and here exception stack;
exception in thread "main" com.orientechnologies.orient.core.exception.ocommandexecutionexception: cannot execute non idempotent command @ com.orientechnologies.orient.core.storage.ostorageembedded.executecommand(ostorageembedded.java:90) @ com.orientechnologies.orient.core.storage.ostorageembedded.command(ostorageembedded.java:85) @ com.orientechnologies.orient.core.sql.query.osqlquery.run(osqlquery.java:69) @ com.orientechnologies.orient.core.sql.query.osqlsynchquery.run(osqlsynchquery.java:82) @ com.orientechnologies.orient.core.query.oqueryabstract.execute(oqueryabstract.java:29) @ com.orientechnologies.orient.core.db.record.odatabaserecordabstract.query(odatabaserecordabstract.java:505) @ com.orientechnologies.orient.core.db.odatabaserecordwrapperabstract.query(odatabaserecordwrapperabstract.java:188) @ com.orientechnologies.orient.jdbc.orientjdbcpreparedstatement.executequery(orientjdbcpreparedstatement.java:73) @ org.octopus.dao.jeudonnees.impl.jdbcjeudonneesdao.create(jdbcjeudonneesdao.java:39) @ org.octopus.dao.jeudonnees.impl.jdbcjeudonneesdao.create(jdbcjeudonneesdao.java:1) @ org.octopus.tests.tests.main(tests.java:23)
it seems it's not possible run non idempotent commands using orient jdbc driver. help
the standard way call insert jdbc using .executeupdate():
http://www.mkyong.com/jdbc/jdbc-preparestatement-example-insert-a-record/
Comments
Post a Comment