/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Dao;

import DataEntryBean.MicroFileAccountDetBean;
import LoginDb.DbHandler;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import oracle.jdbc.OracleTypes;

/**
 *
 * @author 1004242
 */
public class ChequePostingDao_old {


     public String PostChequeProc(String tellerId, String pacsId,String accNo,String chqNo,String chqDt,Double chqAmt,String chqBnk) {
        Connection con = null;
        CallableStatement proc = null;
        String res = null;
       
        
        try {
            con = DbHandler.getDBConnection();
            proc = con.prepareCall("{ call operations1.POST_CHEQUE(?,?,?,?,?,?,?,?) }");

                          proc.setString(1, tellerId);
                          proc.setString(2, pacsId);
                          proc.setString(3, accNo);
                          proc.setString(4, chqNo);
                          proc.setString(5, chqDt);
                          proc.setDouble(6, chqAmt);
                          proc.setString(7, chqBnk);
                          proc.registerOutParameter(8, OracleTypes.VARCHAR);
                          

                          proc.executeUpdate();

                          res = proc.getString(8);//error message from dds procedure

        } catch (Exception e) {
           // e.printStackTrace();
           // System.out.println("Exception occured  in PostChequeProc for user Id :" + tellerId);
           System.out.println("Error occurred during processing.");
        } finally {
            try {
                if (con != null) {
                    con.close();
                }
            } catch (Exception e) {
               // e.printStackTrace();
               System.out.println("Error occurred during connection close.");
            }
        }

        return res;
    }


    
}
