• Post Reply Bookmark Topic Watch Topic
  • New Topic

query not work properly every time!  RSS feed

Ranch Hand
Posts: 593
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!