1 23 24 package org.infoglue.cms.util.workflow; 25 26 import java.sql.Connection ; 27 import java.sql.PreparedStatement ; 28 import java.sql.ResultSet ; 29 import java.sql.SQLException ; 30 import java.util.Map ; 31 32 import com.opensymphony.workflow.StoreException; 33 34 35 40 public class InfoGlueMySQLJDBCWorkflowStore extends InfoGlueJDBCWorkflowStore 41 { 42 43 45 private String _stepSequenceIncrement = null; 46 private String _stepSequenceRetrieve = null; 47 48 50 public void init(Map props) throws StoreException 51 { 52 super.init(props); 53 _stepSequenceIncrement = (String ) props.get("step.sequence.increment"); 54 _stepSequenceRetrieve = (String ) props.get("step.sequence.retrieve"); 55 } 56 57 protected long getNextStepSequence(Connection c) throws SQLException 58 { 59 PreparedStatement stmt = null; 60 ResultSet rset = null; 61 62 try { 63 stmt = c.prepareStatement(_stepSequenceIncrement); 64 stmt.executeUpdate(); 65 rset = stmt.executeQuery(_stepSequenceRetrieve); 66 67 rset.next(); 68 69 long id = rset.getLong(1); 70 71 return id; 72 } 73 finally 74 { 75 cleanup(null, stmt, rset); 76 } 77 } 78 } 79 80 | Popular Tags |