File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes query not work properly every time! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "query not work properly every time!" Watch "query not work properly every time!" New topic

query not work properly every time!

Mandar Khire
Ranch Hand

Joined: Sep 11, 2007
Posts: 557

I create java program with database mysql, connectivity hibernate.
By Java program i handle 90 or 900 or 9000 small Jpanel within Big Jpanel, handle means drag & drop. I save co-ordinates in db table.
I faced many test conditions & solved as many as possible with the help of this forum.
Now i got 3 different ways to do this kind of program.
Now In this topic,
when in swing program in mousereleased event i call

where setlocation1 is another function which used for send co-ordinates to function which check overlap or not with the help of sql query or set panel at calculated location(this i learn from one my old post in coderanch).

where checkoverlap function written for call getoverlap fucntion to call sql query, & set flag.

I write SQL query to check overlap of 2 rectangles with the help of Rectangle's 4 co-ordinate.

now when i run program with 90 or 900 or 9000 panels, no problem for set all panels at calculated position at first time, in db also panels all co-ordinates save properly.
but when i try to drag panel & mouse released at overlap position on another panel, my above group of functions work fine & set dragged panel its original position means
it avoid overlap, but i do this for 10 times 20 times then it give trouble. overlap_flag should true whenever panel overlap. but it not get true due to something not work properly.
I write print statement which give me result list size, when overlap occurs it give no>0, but i can see in program overlap done but in console i see print statement give 0 means no overlap.
How all above functions work correctly for few times & for few times work wrongly & again work correctly?
Please somebody help me.

Millions saw the apple fall, but Newton asked why.
I agree. Here's the link:
subject: query not work properly every time!
It's not a secret anymore!