DAL in oracle
Answer / guest
public List<EEmployeeDetails> GetDetails(int
intEmpId, DateTime fromDate, DateTime toDate, int
intPageNo, int intPageSize, out int intTotalRecords, string
strOrderBy)
{
List<EEmployeeDetails> ListDetails = new
List<EEmployeeDetails>();
intTotalRecords = 0;
try
{
using (OracleDataReader objReader =
DataClient.ExecuteReader(ConnectionString,
CommandType.StoredProcedure, PROCEDURE_GET, GetDetailParams
(intEmpId, intReconciledstatus, fromDate, toDate,
intPageNo, intPageSize, strOrderBy)))
{
while (objReader.Read())
{
EEmployeeDetails
objEEmployeeDetails = new EEmployeeDetails();
if (!string.IsNullOrEmpty(objReader
["Employee_ID"].ToString()))
objEEmployeeDetails.EMPLOYEEId =
Convert.ToInt32(objReader["Employee_ID"]);
if (!string.IsNullOrEmpty(objReader
["EMPLOYEE_NUMBER"].ToString()))
objEEmployeeDetails.EMPLOYEENumber
= (string)(objReader["EMPLOYEE_NUMBER"]);
if (!string.IsNullOrEmpty(objReader
["EMPLOYEE_DATE"].ToString()))
if (!string.IsNullOrEmpty(objReader
["AMOUNT"].ToString()))
objEEmployeeDetails.Amount =
Convert.ToInt32(objReader["AMOUNT"]);
if (!string.IsNullOrEmpty(objReader
["TOTAL"].ToString()))
objEEmployeeDetails.Total =
Convert.ToInt32(objReader
["TOTAL"]);
intTotalRecords = Convert.ToInt32
(objReader["TOTAL"]);
ListDetails.Add
(objEEmployeeDetails);
}
}
}
catch (Exception ex)
{
bool rethrow =
ExceptionPolicy.HandleException(ex, "Propagate Policy");
if (rethrow)
{
throw ex;
}
}
return ListDetails;
}
///<summary>
///helper class for get details
///
/// </summary>
public static OracleParameter[] GetDetailParams(int
intEmpId, DateTime fromDate, DateTime toDate, int
intPageNo, int intPageSize, string strOrderBy)
{
OracleParameter[] sqlParams = null;
try
{
sqlParams = DataClient.GetCachedParameterSet
(ConnectionString, PROCEDURE_GET);
if (sqlParams == null || sqlParams.Length
== 0)
{
sqlParams = new OracleParameter[]
{
new OracleParameter(PARAM_ID,
OracleDbType.Int32),
new OracleParameter(PARAM_STATUS ,
OracleDbType.Int32),
new OracleParameter(PARAM_FROMDATE,
OracleDbType.Date),
new OracleParameter(PARAM_TODATE,
OracleDbType.Date),
new OracleParameter
(PARAM_RETURN,OracleDbType.Int32),
new OracleParameter(PARAM_REFCURSOR,
OracleDbType.RefCursor),
new OracleParameter(PARAM_PAGENUM,
OracleDbType.Int32),
new OracleParameter(PARAM_PAGESIZE,
OracleDbType.Int32),
new OracleParameter (PARAM_TOTALCOUNT,
OracleDbType.Int32),
new OracleParameter(PARAM_ORDERBY,
OracleDbType.Char)
};
DataClient.CacheParameterSet
(DataClient.CONN_STRING, PROCEDURE_GET, sqlParams);
sqlParams
[0].Direction=ParameterDirection.InputOutput;
sqlParams[0].Value = intEmpId;
sqlParams[2].Value = fromDate;
sqlParams[3].Value =
toDate;
sqlParams
[4].Direction=ParameterDirection.Output;
sqlParams
[5].Direction=ParameterDirection.Output;
sqlParams[6].Value = intPageNo;
sqlParams[7].Value = intPageSize;
sqlParams[8].Direction =
ParameterDirection.Output;
sqlParams[9].Value = strOrderBy;
}
}
catch (Exception ex)
{
var rethrow =
ExceptionPolicy.HandleException(ex, "Propagate Policy");
if (rethrow)
{
throw ex;
}
}
return sqlParams;
}
Is This Answer Correct ? | 0 Yes | 0 No |
plzzzzzzzzz xplain this code import java.awt.*; import java.awt.event.*; public class Agency extends Frame implements ActionListener { Label l1,l2,l3,l4; Button b1; TextField t1,t2; String s1,s2,s3,s4; public static void main(String args[]) { new Agency().setVisible(true); } public Agency() { super("Gas Agency Package"); setSize(1280,800); setBackground(Color.lightGray); setLayout(null); // setLayout(new BorderLayout()); t1=new TextField(20); t1.setBounds(440,150,200,30); t1.setBackground(Color.white); t2=new TextField(20); t2.setBounds(440,180,200,30); t2.setBackground(Color.white); t2.setEchoChar('*'); l1=new Label("Gas Agency Package"); l1.setBounds(400,30,300,50); l1.setFont(new Font("TimesRoman",Font.BOLD,25)); l1.setAlignment(Label.CENTER); l2=new Label("Enter your ID and Passoword"); l2.setFont(new Font("TimesRoman",Font.BOLD,20)); l2.setBounds(270,80,300,50); l3=new Label("Enter ID"); l2.setFont(new Font ("TimesRoman",Font.BOLD,20)); l3.setBounds(270,150,120,50); l4=new Label("Enter Passoword"); l2.setFont(new Font ("TimesRoman",Font.BOLD,20)); l4.setBounds(270,180,140,50); add(l1); add(l2); add(l3); add(t1); add(l4); add(t2); b1=new Button("Login"); b1.setBackground(Color.white); b1.setBounds(400,280,100,70); b1.addActionListener(this); add(b1); } public void actionPerformed(ActionEvent e) { if(e.getSource()==b1) { s3="svce"; s4="svce"; s1=t1.getText(); s2=t2.getText(); if(s1.equals(s3) && s2.equals(s4)) { //System.out.println("password is correct"); MenuForm m= new MenuForm(); m.setVisible(true); //this.dispose(); } else { System.out.println("password not correct"); } this.dispose(); } } } plzzzzzzzzz xplain this code
Could u please tell me any UNIX scripts that 'll lead to find the network latency of the servers.?or else any unix command to find the network latency of a server?Thnx in advance...
Write a Program to truncate a given floating point value (e.g.16.25=16).
I have multiple datasets and I have to search a particular string in all of them at a single time. Please suggest a full jcl or rexx tool for it.
How can we write an algorithm for show max and min from two integer inputs ? without using if() , without any functions ...
Write a code snippet to display an integer in a binary format?
Devise a program to implement the Fibonacci sequence.
WORKING STORAGE 01 WS-LENGTH PIC 9(1) VALUE 5. 01 DFHCOMMAREA. COPY ABCDEF (COPYBOOK ABCDEF IS HAVING ONLY ONE VARIABLE OF LENGTH X (100).) .. PROCEDUER DIVISION. ... EXEC CICS XCTL PROGRAM (WS-PGM) COMMAREA (DFHCOMMAREA) LENGTH (WS-LENGTH) RESP (WC-RESPONSE) END-EXEC 1. What will be the value of EIBCALEN in program ABCDEF? 2. What will be length of commarea when in ABCDEF? 3. Will such a code thow any error while linking to called program? Thanks in Advance
Design a timer circuit using VHDL which has the following: input : start_timer(ST) output: long_time(LT) short_time(ST) when the timer is triggered by the ST(either 0 or 1) signal the timer should generate two timing signals accordingly.While the long time is going ON the other should be OFF and vice versa.
Write a program in prolog to compute the factorial of a number using iteration/tail recursion?
How to find the list of users who have two codes su01 and pfcg? thank in advance all.
plzzzzzzzzz xplain this code import java.awt.*; import java.awt.event.*; import java.awt.MenuItem.*; import java.sql.*; import sun.jdbc.odbc.*; import java.io.*; public class MarkDelivery extends Frame implements ActionListener { Label l1,l2,l3,l4,l5,l6,l7; Button exit,save,next,top,prev,botm,ad; TextField txtCMemoNo,txtConsNo,txtCMemoDt,txtConsName,txtAddr1,txtBook ingNo,adr2,adr3; public static void main(String sr[]) { new MarkDelivery().setVisible(true); } public MarkDelivery() { super("Mark Delivery"); Statement stmt; ResultSet rs; //PreparedStatement pst; Connection con; try { Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:Agency"); if (con!=null); System.out.println ("connected"); stmt =con.createStatement (); } catch(Exception e1) { System.out.println (e1); } setSize(1280,800); setBackground(Color.lightGray); setLayout(null); l1=new Label("Cashmemo No"); l1.setBounds(260,60,90,30); l1.setFont(new Font ("TimesRoman",Font.PLAIN,15)); l1.setAlignment(Label.CENTER); add(l1); l1=new Label("Booking No"); l1.setBounds(30,90,90,30); l1.setFont(new Font ("TimesRoman",Font.PLAIN,15)); l1.setAlignment(Label.CENTER); add(l1); l2=new Label("CONSMR NO"); l2.setBounds(30,60,90,30); l2.setFont(new Font("TimesRoman",Font.PLAIN,15)); l2.setAlignment(Label.CENTER); add(l2); l3=new Label("Cashmemo Date"); l3.setBounds(520,60,130,30); l3.setFont(new Font ("TimesRoman",Font.PLAIN,15)); l3.setAlignment(Label.CENTER); add(l3); l4=new Label("NAME"); l4.setBounds(30,150,45,30); l4.setFont(new Font ("TimesRoman",Font.PLAIN,15)); l4.setAlignment(Label.CENTER); add(l4); l5=new Label("ADRS"); l5.setBounds(30,220,45,30); l5.setFont(new Font ("TimesRoman",Font.PLAIN,15)); l5.setAlignment(Label.CENTER); add(l5); txtBookingNo=new TextField(); txtBookingNo.setBounds(130,90,80,30); txtBookingNo.setBackground(Color.white); add(txtBookingNo); txtCMemoNo=new TextField(); txtCMemoNo.setBounds(375,60,80,30); txtCMemoNo.setBackground(Color.white); add(txtCMemoNo); txtConsNo=new TextField(); txtConsNo.setBounds(130,60,80,30); txtConsNo.setBackground(Color.white); add(txtConsNo); txtCMemoDt=new TextField(); txtCMemoDt.setBounds(635,60,80,30); txtCMemoDt.setBackground(Color.white); add(txtCMemoDt); txtConsName=new TextField(); txtConsName.setBounds(100,150,200,30); txtConsName.setBackground(Color.white); add(txtConsName); txtAddr1=new TextField(); txtAddr1.setBounds(100,220,350,30); txtAddr1.setBackground(Color.white); add(txtAddr1); adr2=new TextField(); adr2.setBounds(100,250,350,30); adr2.setBackground(Color.white); add(adr2); adr3=new TextField(); adr3.setBounds(100,280,350,30); adr3.setBackground(Color.white); add(adr3); exit=new Button("EXIT"); exit.setBackground(Color.orange); exit.setBounds(760,700,40,40); exit.addActionListener(this); add(exit); save=new Button("SAVE"); save.setBackground(Color.orange); save.setBounds(715,700,40,40); save.addActionListener(this); add(save); next=new Button("NEXT"); next.setBackground(Color.orange); next.setBounds(90,700,40,40); next.addActionListener(this); add(next); top=new Button("TOP"); top.setBackground(Color.orange); top.setBounds(0,700,40,40); top.addActionListener(this); add(top); prev=new Button("PREV"); prev.setBackground(Color.orange); prev.setBounds(45,700,40,40); prev.addActionListener(this); add(prev); botm=new Button("BOTM"); botm.setBackground (Color.orange); botm.setBounds (135,700,40,40); botm.addActionListener (this); add(botm); ad=new Button("ADD"); ad.setBackground (Color.orange); ad.setBounds (300,700,40,40); ad.addActionListener (this); add(ad); } public void actionPerformed(ActionEvent e) { if(e.getSource()==exit) { this.dispose(); System.exit(0); } /* if(e.getSource()==save) { try { Connection con=DriverManager.getConnection("jdbc:odbc:Agency"); PreparedStatement pst=con.prepareStatement("INSERT INTO NewCon values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); pst.setInt (1,Integer.parseInt(txtConsNo.getText())); pst.setInt (2,Integer.parseInt(txtSvNo.getText())); pst.setString (3,txtSvDt.getText()); pst.setString (4,txtConsName.getText()); pst.setInt(5,Integer.parseInt (txtPhNo.getText())); pst.setString(6,txtAddr1.getText()); pst.setString(7,adr2.getText()); pst.setString(8,adr3.getText()); pst.setInt(9,Integer.parseInt (txtCylQty.getText())); pst.setInt(10,Integer.parseInt (txtCylDep.getText())); pst.setInt(11,Integer.parseInt (txtRegQty.getText())); pst.setInt(12,Integer.parseInt (txtRegDep.getText())); pst.setInt(13,Integer.parseInt (tot.getText())); pst.setInt(14,Integer.parseInt (stnry.getText())); pst.setString(15,rmrk.getText()); pst.executeUpdate (); con.close(); } catch(Exception e2) {System.out.println(e2);} //cs(txtConsName.getText (),txtAddr1.getText()); } if(e.getSource()==ad) { try { Connection con1=DriverManager.getConnection("jdbc:odbc:Agency"); Statement stmt1=con1.createStatement(); ResultSet rs1=stmt1.executeQuery("SELECT Max(Cons_No) FROM NewCon"); int nextcono = rs1.getInt ("Cons_No"); System.out.println (nextcono); nextcono=nextcono+1; txtConsNo.setText ("nextcono"); txtSvNo.setText(""); txtSvDt.setText(""); txtConsName.setText(""); txtAddr1.setText(""); txtPhNo.setText(""); txtCylQty.setText(""); txtCylDep.setText(""); txtRegDep.setText(""); txtRegQty.setText(""); adr2.setText(""); adr3.setText(""); tot.setText(""); stnry.setText(""); rmrk.setText(""); con1.close(); } catch(Exception e4){} }*/ } }