hello everyone.i have just started programming in EJB.i am tring to make an application for online banking system.During the compilation, i am getting the error of missing return statement in all functions where retrun type is String.i am trying to get the output in a JSP page....here is one of the function of my EJB
public String ins_Deposit(String userid,int amount,String branch,String bank) throws SQLException
{
Statement ps = null;
try
{
ps = conn.createStatement();
String query="INSERT INTO BANK_TRANSACT VALUES('"+userid+"',sys_date,"+amount+",'D','"+branch+"','"+bank+"')";
int result = ps.executeUpdate(query);
if(result>0)
return "Transaction successfully completed,amount will be credited to your account within 24hrs. ";
else
return "Bank timings are between 8 AM to 8 PM IST,Record not inserted";
}
catch(SQLException e)
{
System.out.println("Unable to get Data: " + e);
}
}
next is the code of jsp from where i am calling the function in my ejb
mybank mbk=null;
InitialContext initial=new InitialContext();
Object objref=initial.lookup("mydatabase");
mybankHome home_ctr=(mybankHome)PortableRemoteObject.narrow(objref,mybankHome.class);
mybank cur_conv=home_ctr.create();
cur_conv.getCustname(ename);
String deposit_amt=request.getParameter("dep_amt");
int amt=Integer.parseInt(deposit_amt);
String act_num=request.getParameter("acc_no");
String branch_id=request.getParameter("br_no");
String bank_name=request.getParameter("bank");
String cust_id=(String)session.getValue("CUST_ID");
String depstmt=cur_conv.ins_Deposit(cust_id,amt,branch_id,bank_name);
please help