?? mysqlworkflowstore.java
字號(hào):
/* * Copyright (c) 2002-2003 by OpenSymphony * All rights reserved. */package com.opensymphony.workflow.spi.jdbc;import com.opensymphony.workflow.StoreException;import java.sql.Connection;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLException;import java.util.Map;/** * @author Christopher Farnham * Created on Feb 27, 2004 */public class MySQLWorkflowStore extends JDBCWorkflowStore { //~ Instance fields //////////////////////////////////////////////////////// protected String entrySequenceIncrement = null; protected String entrySequenceRetrieve = null; protected String stepSequenceIncrement = null; protected String stepSequenceRetrieve = null; //~ Methods //////////////////////////////////////////////////////////////// public void init(Map props) throws StoreException { super.init(props); stepSequenceIncrement = (String) props.get("step.sequence.increment"); stepSequenceRetrieve = (String) props.get("step.sequence.retrieve"); entrySequenceIncrement = (String) props.get("entry.sequence.increment"); entrySequenceRetrieve = (String) props.get("entry.sequence.retrieve"); } protected long getNextEntrySequence(Connection c) throws SQLException { PreparedStatement stmt = null; ResultSet rset = null; try { stmt = c.prepareStatement(entrySequenceIncrement); stmt.executeUpdate(); rset = stmt.executeQuery(entrySequenceRetrieve); rset.next(); long id = rset.getLong(1); return id; } finally { cleanup(null, stmt, rset); } } protected long getNextStepSequence(Connection c) throws SQLException { PreparedStatement stmt = null; ResultSet rset = null; try { stmt = c.prepareStatement(stepSequenceIncrement); stmt.executeUpdate(); rset = stmt.executeQuery(stepSequenceRetrieve); rset.next(); long id = rset.getLong(1); return id; } finally { cleanup(null, stmt, rset); } }}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -