Rico ZHANG

Greenhorn
+ Follow
since Apr 28, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rico ZHANG

Thanks Peter, this is exactly what I was after.
The thing is I cannot find where to import the project by ant. I remember in old version of Eclipse, there was a option called "Import existing project by ant " or something when I tried to import a project. I cannot find it now.
Hi Guys,


I haven't worked on Java stuff for a while, and recently I need to work on a project with Eclipse. I got a problem when I tried to import a project with a ant build.xml file, I cannot found how to do that any more.

I remember it should show up in the list when I select import a project.now it is not there any more.

Could anyone help me out with that?


Cheers
Hi Guys,

I am using the VALUE OBJECT pattern which is mentioned in Andrew's book, but I am stuck with a question.

In the instruction of the assignment, in the header information part, it includes the DB schema as well, and all of the field names and length can be found here.
After I read every Record information, I need to populate all the field values into the OBJECT,in my Case, my Record Object is called Contract.And I will populate the information like this(similar to Andrew's book's example)
I will use the Length which grabbed from the header information part.
String name=fieldReader.readField(****,****);
String location=fieldReader.readField(****,****);
String spec=fieldReader.readField(****,****);
...
...
Then : Contract contract=new Contract(name,location,spec,.....)

But if I do this, I have to assume that I have known all of the field names already;I am just wonderring whether it is ok to do that.
Otherwise I have to put a HashMap into the Record Object, then put all the field names and field values into the HashMap. This way will be more generic, then it can be used in future even the DB structure is changed; But it is not tat convenient anyway; and will be weird for a DB application.

Is there anyone using this the OBJECT VALUE pattern? how do you deal with tat?

Cheers
Thanks Edwin.

I agree with you, and I was thinking about same thing as you...but I saw some guys here just hard coded something to make the application easier.. So I just thinking maybe I can do the hard coding for all the header information..

But I think you are right,,,
Hi Guys,

Just want to know can I set the other header information as final static variables(coz tat will be much easier), or I should load it from the db file every time I need them.

i.e, the length of every field in a record,
the offSet of the Record 0..

things like this.

Hope that someone can help me

Thanks...
Hi Guys,

I got a similar question.
Just want to know can I set the other header information as final static variables(coz tat will be much easier), or I should load it from the db file every time I need them.

i.e, the length of every field in a record,
the offSet of the Record 0..

things like this.

Thanks...
Hi Guys,
I got the B&S assignment, but after I read the offset from header information.
I tried to read the record from the DB file by this way: dataInStream.read(byteArray, offset,len), but I cannot get what I need here.

I know the offset is the 4 byte numeric value in the header, did I do the wrong thing to read the records?

Anyone can help me?Cheers