public MailAccount getAccountDetails( int userid , HashMap preference )
{
MailAccount mailaccount = new MailAccount();
try
{
//System.out.println( "getAccountDetails"+ (Integer)preference.get("AccountID") );
int accountid = ((Integer)preference.get("AccountID")).intValue();
System.out.println( "getAccountDetails"+ accountid );
CVDal cvdl = new CVDal(dataSource);
Collection v = null;
cvdl.setSql("email.getemailaccountforedit");
cvdl.setInt( 1 , accountid );
v = cvdl.executeQuery();
cvdl.clearParameters();
cvdl.destroy();
Iterator it = v.iterator();
HashMap hm = ( HashMap )it.next();
int account = ( (Number)hm.get("AccountID")).intValue();
mailaccount.setAccountID( account );
String address = (String)hm.get("Address") ;
//System.out.println( address);
mailaccount.setAddress( address );
String leaveonserver = (String)hm.get("LeaveOnServer") ;
//System.out.println( leaveonserver);
mailaccount.setLeaveonserver( leaveonserver );
String login = (String)hm.get("Login") ;
//System.out.println( login);
mailaccount.setLogin( login );
String mailserver = (String)hm.get("mailserver") ;
//System.out.println( mailserver );
mailaccount.setMailserver(mailserver);
String smtpserver = (String)hm.get("SMTPServer") ;
//System.out.println( mailserver );
mailaccount.setSmtpserver(smtpserver);
String port = ((Number)hm.get("Port")).intValue() +"";
//System.out.println( mailserver );
mailaccount.setPort(port);
String name = (String)hm.get("Name") ;
//System.out.println( name);
mailaccount.setName(name );
String password = (String)hm.get("Password") ;
//System.out.println( password);
mailaccount.setPassword( password );
String replyto = (String)hm.get("ReplyTo") ;
//System.out.println( replyto);
mailaccount.setReplyto( replyto );
String servertype = (String)hm.get("ServerType") ;
//System.out.println( servertype );
mailaccount.setServertype(servertype );
String signature = (String)hm.get("Signature") ;
//System.out.println( signature);
mailaccount.setSignature( signature );