|
示意代码:
import java.math.*;
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.*;
import java.sql.SQLException;
import com.justep.system.data.*;
public class MyJob {
public static String doTicketsSQLInsert(String atTable,String byField,String inDate,String isGetSet,String myTGUID,String toVoucher){
HashMap<String,String> sqlMap = new HashMap<String,String>();
String sSQL = "INSERT INTO DM_TTickets(fBillTable,fCodeNum,fDateChar,fFieldNum"
+ ",fStatus,fTGUID,fTimeTick)"
+ " VALUES('"+atTable+"','"+sNewNum+"','"+inDate+"','"+byField
+ "','"+isGetSet+"','"+myTGUID+"',GETDATE()"
+ ")";
System.out.println("sSQL:"+sSQL);
sqlMap.put(DatabaseProduct.MSSQL.name(), sSQL);
int nEffect = SQL.executeUpdate(sqlMap, null, "/CommonHFC/Comm/data");
//在这里我想立即提交数据库事务,以便其它用户马上可以读到刚才写入的数据。如何做?
}
}
============================================
|
|