1 package dinamica.security; 2 3 import dinamica.*; 4 import javax.sql.DataSource ; 5 import java.sql.*; 6 7 15 public class UpdateProfile extends GenericTransaction 16 { 17 18 21 public int service(Recordset inputParams) throws Throwable 22 { 23 24 super.service(inputParams); 25 26 String jndiName = (String )getContext().getAttribute("dinamica.security.datasource"); 28 if (jndiName==null) 29 throw new Throwable ("Context attribute [dinamica.security.datasource] is null, check your security filter configuration."); 30 31 DataSource ds = Jndi.getDataSource(jndiName); 33 Connection conn = ds.getConnection(); 34 this.setConnection(conn); 35 36 try 37 { 38 39 String sql = getSQL(getResource("update.sql"), inputParams); 41 Db db = getDb(); 42 db.exec(sql); 43 44 Login obj = (Login)getObject("dinamica.security.Login"); 47 obj.getUserPrefs(db, inputParams); 48 49 } 50 catch (Throwable e) 51 { 52 throw e; 53 } 54 finally 55 { 56 if (conn!=null) 57 conn.close(); 58 } 59 60 return 0; 61 62 } 63 64 } 65 | Popular Tags |