0 Replies Latest reply on Oct 25, 2005 11:17 AM by Eduardo Lopez

    Commit option A and direct JDBC statements

    Eduardo Lopez Newbie

      May I use commit option A and execute update sentences throw JDBC like this:

       javax.sql.DataSource dataSource = (javax.sql.DataSource) homeFactory.lookup(
       "java:/GlobalDS", javax.sql.DataSource.class);
      
       Connection conn = null;
       try {
       conn = dataSource.getConnection();
       PreparedStatement stmNota = conn .prepareStatement(
       "UPDATE NOTES (NOTESTATE, DATE VALUES ('P','" +
       util.dateNow() + "') WHERE ID = " + id.intValue());
       stmNota.executeUpdate();
       stmNota.close();
       conn .close();
      
       }
       catch (Exception exc) {
       exc.printStackTrace();
       }