473,657 Members | 2,556 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I need Hashing program!!!!

1 New Member
hi,

help me!!! i need hashing program in C or in Java..

tnx,
cheche
Sep 6 '06 #1
1 3458
ssehgal2010
10 New Member
HI
Below is the code which I wrote for one application in JAVA
in this I used Hash I think it may help you a little



import javax.servlet.S ervletException ;
import javax.servlet.h ttp.HttpServlet ;
import javax.servlet.h ttp.HttpServlet Request;
import javax.servlet.h ttp.HttpServlet Response;

import java.io.*;
import java.util.*;
import javax.servlet.* ;
import javax.servlet.h ttp.*;
import java.text.*;
import java.util.Date;
import java.util.Calen dar;

public class DAUpdate extends HttpServlet {

private String IP,port,user,pa ssword, OpertionType;

public void doGet(HttpServl etRequest request, HttpServletResp onse response)
throws IOException, ServletExceptio n {
doPost(request, response);

}

public void doPost(HttpServ letRequest request, HttpServletResp onse res) {
String AccountName ;
ArrayList result = new ArrayList();
Object retobj = new Object();
String partnerid;
int counter;
String InterResult;
Hashtable ServiceDARecord = new Hashtable();
//Intermediate Result added by Awkash 09/01/2006
String ServiceDARecord Keys[] =
{
"TransactionTyp e" ,
"ServiceID" ,
"EventID" ,
"InstrumentType " ,
"IntermediateRe sult",
"ServiceNam e" ,
"ShareType" ,
"ShareValue " ,
"PartnerID" ,
"DiscountTy pe" ,
"DiscountRa te" ,
"EffectiveStart Date" ,
"EffectiveEndDa te",

};


//getting values from session
HttpSession session = request.getSess ion(true);
user = (String)session .getAttribute(" PBSUserName");
password = (String)session .getAttribute(" PBSUserPass");
IP=(String)sess ion.getAttribut e("PBSIP");
port=(String)se ssion.getAttrib ute("PBSport");
//partnerid = (String)session .getAttribute(" partnerid");
String ServiceType = (String)session .getAttribute(" ServiceType");

int updateFlag = 0;

int i=0;
int j=0;
//String PartnerID = partnerid;
Object Values[][] = new Object[1][16];//its size is 15 earlier
String textbox;
String thpHost ="10.8.54.64 ";
String thpPort ="10009"; // FOR RIC_DEV Use This Port "10009";
Properties properties = new Properties();
properties.setP roperty("ThpHos t", IP);
properties.setP roperty("ThpPor t", port);
TreConnection conn = new TreConnection(p roperties);
conn.treConnect (user,password, "");

String temp;
PrintWriter out;
try{
out = res.getWriter() ;
}catch(Exceptio n exc){
return;
}

//System.out.prin tln("Service Type : " + ServiceType + " in DAInsert.java") ;

for (i=0;i<=0;i++) { //We are having only one row at any given time
//Index inceramented to handle additional field intermediate results
for (j=0;j<=12;j++) {
textbox= "x"+i+"y"+j ;

if (j==11){
temp = (String)request .getParameter(t extbox);

ServiceDARecord .put(ServiceDAR ecordKeys[j],
new String( temp + " 00:00:00" ));
}
else if (j==12){
temp = (String)request .getParameter(t extbox);

ServiceDARecord .put(ServiceDAR ecordKeys[j],
new String( temp + " 23:59:59" ));
}
else{
temp = (String)request .getParameter(t extbox);
System.out.prin tln("Temp recieved is " + textbox + ": " + temp + "[[");
ServiceDARecord .put(ServiceDAR ecordKeys[j], temp);

}
}
/* Just for debugging*/
//System.out.prin tln("Copying Values in Hash");

// 2 - Update
ServiceDARecord .put("Operation Type", new Integer(2));

ServiceDARecord .put("ServiceTy pe", ServiceType);

ServiceDARecord .put("UpdateFla g", (String)request .getParameter(" updt"));

Object te[] = new Object[1];
te[0] = ServiceDARecord ;

try{



System.out.prin tln("Calling fRIC_Partner_Bi llingDA_Update. ..");
retobj = conn.treVariant Call("fRIC_Part ner_BillingDA_U pdate?[]",new Date(),te);

counter = i + 1;
out.println("Ro w Inserted.\n" );
result = (ArrayList)reto bj;
//Putting result in session to be extracted later
//session.setAttr ibute("val", result);

//System.out.prin tln("result ArrayList :" + result);
conn.treDisconn ect();
res.sendRedirec t("Rep_Partner_ Service_Details .jsp");
//res.sendRedirec t("Rep_Partner_ Service_Details .jsp");
//System.out.prin tln(result);

}
catch(Exception exc){
System.out.prin tln(exc.toStrin g());
out.println(exc .toString());
return;
}
finally{
//conn.treDisconn ect();
}
}
//conn.treDisconn ect();
}
}
Sep 6 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2263
by: Jim | last post by:
I am a FoxPro programmer. What software do I need to program using MS access... I have apps that are non-web standalone and some web based... Do you recommend any learning resources? thanks for any info.
1
1574
by: Bikini Browser | last post by:
Folks: I am not a programmer so I need some help here... I need a small program written that tells me how many days old my daughter is since she was born. She was born September 26th, 2000. I am keeping a journal for her to read when she grows up including photos and I want her to know how many days old
1
1181
by: djg | last post by:
today is the last day that i must submit this assinment and please help to meke this programe now. help me. Part A Each super class vehicle contains plate number, brand name, price and speed. You are supposed to create another subclass type Taxi of vehicle types. You are supposed to include at least another two members for it. Part B Develop a Java program that makes use of array to store the Taxi information. This program must...
3
2093
by: Silent1Mezzo | last post by:
So I'm sitting at work and they don't have enough work for me. And I'm in need of ideas for different programs. I've already built a program that calculates a random drawing of loto 6/49 tickets (you guys might have seen some posts about srand() and rand()). I know need more ideas....help me solve my boredom. Thanks
22
1996
by: arthurps | last post by:
I have 6 files with the name admission.mdb in seperate folders, C:\Admin_1\admission.mdb, C:\Admin_2\admission.mdb, C:\Admin_3\admission.mdb, C:\Admin_4\admission.mdb, C:\Admin_5\admission.mdb, C:\Admin_6\admission.mdb. I need to combinine them and store in C:\Admin folder has admission.mdb. I need a VB program or MS Access code. Please do the needful at the earliest. Thanking you, Arthur.
3
2803
by: sai124 | last post by:
hi iam learning data structures in c++. i want a hashing program in c++ using seperate chaining method and also quadratic probing.
3
3792
tpgames
by: tpgames | last post by:
I'm looking for a program or command line or anything that would allow me to have more than the maximum 4 keyboard layout language groups that keyboard preferences in Ubuntu restricts me too. I can work with 5, but more would be better. I like to switch between US and UK but need German, Russian, Hebrew, Greek, and French as I use these languages often either in conversing, researching, Bible Study, or word game making. Its a pain in the rear to...
0
8397
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7333
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2731
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.