• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

confused about name value pairs in db.db

 
hirsch, kanwal
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i have question about names of origin of a flight and the destination of a flight , they are not the real world names , is that what we are going to use
in our search string when searching in the criteriaFind( String st )
The following is the description of one of the record that i have
in my database
Name = Flight number value = BA002
Name = Origin airport value = BA0
Name = Destination airport value = BA0
Name = Carrier value = BA002SFOLHRBeethAir
Name = Price value = BA002S
Name = Day value = BA0
Name = Time value = BA002
Name = Duration value = BA002SF
Name = Available seats value = BA00
As you see value of origin airport and destination airport is same.Please through some light on it.
thanks
kanwal

Following is the code that came up with the values shown above
Data data = new Data("./suncertify/db/db.db");
for(int i=0; i<=data.getRecordCount(); i++)<br /> {<br /> if (i>=1)
{
DataInfo dataInfo=data.getRecord(i);
FieldInfo [] fInfo = dataInfo.getFields();
System.out.println("The String version of Data item is :"+ dataInfo.toString());
}
}

please reply
thanks
kanwal
 
ramandeep singh
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah
the name of the origin and dest airport are
not user friendly names
Actually they are three digit codes which are used
world wide like JFK, LGA, MCI etc etc
We can map these three char codes to actual names
but I don't suggest that of SCJD appliation
I think we should follow the requirement documentation.
 
hirsch, kanwal
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for reply singh
since the name of the origin of the flight and the destination of the flight are same , you that is what we will be searching for in our criteriaFind(String ) to get the required information
.
 
ramandeep singh
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey I think U must be doing something wrong
I tried the similar code in my application and got
something like this:
suncertify.db.DataInfo@62cb55recordNumber = 1
Fields:Name = Flight number value = SA001
Name = Origin airport value = SFO
Name = Destination airport value = DEN
Name = Carrier value = SpeedyAir
Name = Price value = 400
Name = Day value = Sun
Name = Time value = 13:40
Name = Duration value = 20m
I don't know why U are getting BAO and similar stuff
Reply Back
 
hirsch, kanwal
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
does it tells me that we have two different files or i am doing something wrong . could you try my code that i wrote.
 
hirsch, kanwal
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or can we switch our db.db files and try these out
 
ramandeep singh
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I contact U directly on "charan85008@yahoo.com"
 
hirsch, kanwal
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, you can
 
ramandeep singh
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey
On the second thought, I think there is something wrong
with your data convertor, test it or try reverse conversion
I can smell that U have some problem with ur data convert.
Raman
 
hirsch, kanwal
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok i look into that
 
ramandeep singh
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
chk ur mail also
I have sent my database.txt and database.db file
what U can do is run ur convertor on my txt file
and then compare the generated binary file with
mine
I think it will help
 
hirsch, kanwal
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes uou are right that i have to implement the data converter. which i did not , any tips on that
thanks for helping
 
ramandeep singh
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey come on yaar
don't tell me that U were trying ur stunts on a text file
Any way, regarding convertor.
it is fairly straightforward.
U need to parse the text file and use the
Data class methods to write records into
binary file.
For parsing I used StreamTokenizer, U can also use
string tokenizer or any other approach
Raman
 
hirsch, kanwal
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
alright man!!!
thanks for help .
let you know if i got stuck again
 
hirsch, kanwal
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my assignment came with database in a binary format I do not see any ascii type that i have to convert into the binary format .
Any thoughts into it when implementing the conversion tool. I have not had anything specified as conversion tool in my instructions document.any help
kanwal
[This message has been edited by hirsch, kanwal (edited June 27, 2001).]
 
ramandeep singh
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey i think there is little difference in our assignment.
Actually I have given a text file and as a part of assignment
I have to write a converter to convert the text file
into binary file
 
hirsch, kanwal
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my problem was that i was working with crupted db.db file. Any way my assignement is shipped with db.db in a binary format , so i do not have to write any conversion tool for this

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic