[ 1842534 ] Grant independence to GenerateModel from AD_Process_ID

http://sourceforge.net/tracker/index.php?func=detail&aid=1842534&group_id=176962&atid=879335
This commit is contained in:
vpj-cd 2007-12-02 17:34:28 +00:00
parent f3a7f94b77
commit 2b4ec11d8d
1 changed files with 2 additions and 10 deletions

View File

@ -420,26 +420,18 @@ public class MProcess extends X_AD_Process
* @param String tableName * @param String tableName
* @return int retValue * @return int retValue
*/ */
public static int getProcess_ID(String value) { public static int getProcess_ID(String value, String trxname) {
int retValue = 0; int retValue = 0;
String SQL = "SELECT AD_Process_ID FROM AD_Process WHERE value = ?"; String SQL = "SELECT AD_Process_ID FROM AD_Process WHERE value = ?";
try try
{ {
if (DB.isRemoteObjects()) PreparedStatement pstmt = DB.prepareStatement(SQL, trxname);
{
Server server = CConnection.get().getServer();
retValue = server.getTableID(value);
}
else
{
PreparedStatement pstmt = DB.prepareStatement(SQL, null);
pstmt.setString(1, value); pstmt.setString(1, value);
ResultSet rs = pstmt.executeQuery(); ResultSet rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
retValue = rs.getInt(1); retValue = rs.getInt(1);
rs.close(); rs.close();
pstmt.close(); pstmt.close();
}
} }
catch (Exception e) catch (Exception e)
{ {