1 package de.webman.acl.db.queries; 2 3 import java.sql.Connection ; 4 import java.sql.Types ; 5 import java.sql.SQLException ; 6 import java.sql.ResultSet ; 7 import com.teamkonzept.db.*; 8 import com.teamkonzept.webman.mainint.db.queries.accesscontrol.*; 9 10 import com.teamkonzept.webman.mainint.WebmanExceptionHandler; 11 12 19 public class UserDelete 20 extends TKExtendedPrepQuery 21 { 22 23 25 public static final String [] ORDER = 26 { 27 "WM_USER_ID", 28 "WM_USER_ID" 29 }; 30 31 public static final Object [][] TYPES = 32 { 33 {"WM_USER_ID", new Integer (Types.INTEGER)}, 34 {"WM_USER_ID", new Integer (Types.INTEGER)} 35 }; 36 37 public static final boolean[] RELEVANTS = 38 { 39 false 40 }; 41 42 45 46 public static final String SQL = null; 47 48 protected static Class [] queryClasses = { DeleteWMProfile.class, DeleteWMUser.class }; 49 50 52 public boolean execute() { 53 try { 54 init(queryClasses); 55 56 boolean isNotOpen = aTKDBConnection.isAutoCommit(); 57 if (isNotOpen) { aTKDBConnection.beginTransaction(); } 58 queries[0].setQueryParams("WM_PROFILE_ID", queryParams.get("WM_USER_ID")); 59 queries[0].execute(); 61 queries[1].setQueryParams("WM_USER_ID", queryParams.get("WM_USER_ID")); 62 queries[1].execute(); if (isNotOpen) { aTKDBConnection.commitTransaction(); } 64 65 } 66 catch (SQLException sqle) { 67 WebmanExceptionHandler.getException(sqle); 68 try { 69 aTKDBConnection.rollbackTransaction(); 70 } 71 catch (SQLException sqle2) { 72 WebmanExceptionHandler.getException(sqle2); 73 } 74 } 75 finally { 76 return hasResults(); 77 } 78 } 79 80 public void initQuery (Connection connection) 81 { 82 super.initQuery(connection, 83 true, 84 ORDER, 85 TYPES, 86 RELEVANTS, 87 SQL); 88 } 89 90 } 91 | Popular Tags |