1 5 package com.teamkonzept.publishing.markups.db.queries; 6 7 import java.sql.*; 8 9 import com.teamkonzept.db.*; 10 import com.teamkonzept.webman.mainint.db.queries.markups.*; 11 import com.teamkonzept.webman.mainint.WebmanExceptionHandler; 12 13 17 public class TKMarkupParamDefinitionNew extends CompositeQuery { 18 19 Integer parameterId = null; 20 TKQuery selectMax = null; 21 TKQuery insert = null; 22 TKQuery select = null; 23 24 protected void initConcreteCompositeQuery()throws SQLException { 25 selectMax = registerQuery( SelectMaxTextAttributeParam.class); 26 insert = registerQuery( InsertTextAttributeParam.class); 27 select = registerQuery( SelectTextAttributeParam.class); 28 } 29 30 protected boolean beforeExecution(int i) { 31 try { 32 if (i == 1) { 33 ResultSet rs = selectMax.fetchResultSet(); 34 int paramId = 1; 35 if (rs != null && rs.next()) { 36 paramId = rs.getInt(1) + 1; 37 } 38 parameterId = new Integer (paramId); 39 insert.setQueryParams("PARAMETER_ID", parameterId); 40 select.setQueryParams("PARAMETER_ID", parameterId); 41 } 42 } 43 catch (SQLException sqle) { 44 WebmanExceptionHandler.getException(sqle); 45 } 46 return true; 47 } 48 49 } 50 51 | Popular Tags |