Ooups, a very bad copy-past, sorry and thank you. Is there any way to get what would be the @RID of the inserted row using the OrientDB JDBC driver? I need it to link two classes.
Thank you Le vendredi 31 janvier 2014 17:52:14 UTC+1, Lvc@ a écrit : > > Hi, > the standard way to call an insert with JDBC is by using .executeUpdate() > > http://www.mkyong.com/jdbc/jdbc-preparestatement-example-insert-a-record/ > > Or just look for "jdbc insert" in Google. > > Lvc@ > > > On 31 January 2014 17:29, <[email protected] <javascript:>> wrote: > >> *Hello,* >> >> *I'm facing an issue while using the JDBC driver to connect to a Plocal >> Orient DB.* >> >> *Here is my 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 into personne (name) values(?)";* >> * PreparedStatement stmt = conn.prepareStatement(sql);* >> * stmt.setString(1, "test recuperation RID par jdbc");* >> * ResultSet rs = stmt.executeQuery();* >> ... >> >> *And here the exception stack;* >> >> *Exception in thread "main" >> com.orientechnologies.orient.core.exception.OCommandExecutionException: >> Cannot execute non idempotent command* >> * at >> com.orientechnologies.orient.core.storage.OStorageEmbedded.executeCommand(OStorageEmbedded.java:90)* >> * at >> com.orientechnologies.orient.core.storage.OStorageEmbedded.command(OStorageEmbedded.java:85)* >> * at >> com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OSQLQuery.java:69)* >> * at >> com.orientechnologies.orient.core.sql.query.OSQLSynchQuery.run(OSQLSynchQuery.java:82)* >> * at >> com.orientechnologies.orient.core.query.OQueryAbstract.execute(OQueryAbstract.java:29)* >> * at >> com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.query(ODatabaseRecordAbstract.java:505)* >> * at >> com.orientechnologies.orient.core.db.ODatabaseRecordWrapperAbstract.query(ODatabaseRecordWrapperAbstract.java:188)* >> * at >> com.orientechnologies.orient.jdbc.OrientJdbcPreparedStatement.executeQuery(OrientJdbcPreparedStatement.java:73)* >> * at >> org.octopus.dao.jeudonnees.impl.JdbcJeuDonneesDAO.create(JdbcJeuDonneesDAO.java:39)* >> * at >> org.octopus.dao.jeudonnees.impl.JdbcJeuDonneesDAO.create(JdbcJeuDonneesDAO.java:1)* >> * at org.octopus.tests.tests.main(tests.java:23)* >> >> *It seems like it's not possible to run non idempotent commands using the >> Orient JDBC Driver.* >> >> *Thanks for your help* >> >> >> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "OrientDB" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
