|
|
Welcome to the Java Forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
- have access to post topics
- communicate privately with other members (PM)
- not see advertisements between posts
- have the possibility to earn one of our surprises if you are an active member
- access many other special features that will be introduced later.
Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact us.
|
|

05-25-2008, 02:13 PM
|
 |
Senior Member
|
|
Join Date: Mar 2008
Location: Delhi, India
Posts: 187
|
|
will some one tell me how to debug a prepared statement
i have asked this question several times but no body answered  so thought on posting it here, as it is having highest number of views as well as post 
__________________
i am the future
|
|

05-26-2008, 06:14 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
As far as I know you can't to that.
But you can do one thing. In most of the cases where I can't involve I do quite similar thing.
If you have any parameters to set in your statement, do it first and try to print the result and see you get the correct output.
What type of application you working on.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

05-26-2008, 12:23 PM
|
 |
Senior Member
|
|
Join Date: Mar 2008
Location: Delhi, India
Posts: 187
|
|
thts a secret project
actually i had created a debugger for preparedstatement, which was working great till i had not used pooling. must to mention the code was eclipse specific. i used reflection to get the sql statement, then parameters, substituted them in correct place, and voila it was printing the complete sql in very nice manner, and easy to debug [ life was good  ]. but now i don't want to rework on that!! if it is possible to have better solution. 
__________________
i am the future
|
|

05-26-2008, 12:29 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
Nice. All the what I have done is that what I say in my previous post.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

05-26-2008, 01:23 PM
|
 |
Senior Member
|
|
Join Date: Mar 2008
Location: Delhi, India
Posts: 187
|
|
Nice. All the what I have done is that what I say in my previous post.
i am layman to understand your post 
__________________
i am the future
|
|

05-26-2008, 01:27 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
I mean in the past you have done it, on Eclipse, right?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-15-2008, 09:29 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
Hey guys, gals
What happened to our quiz time.
Here is one from me to take a start again. 
What is the output of this, be honest not to use any IDE. 
boolean b = false;
if(b = true) {
System.out.println("b is true");
}
else {
System.out.println("b is false");
}
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-15-2008, 12:49 PM
|
 |
Senior Member
|
|
Join Date: Mar 2008
Location: Delhi, India
Posts: 187
|
|
The Code will not compile. no assignment ca be done in Conditional statement
__________________
i am the future
|
|

06-15-2008, 01:21 PM
|
 |
Senior Member
|
|
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 527
|
|
|
I've used that before....
Im sure that it will print "b is true";
Not all assignment statement doesn't return any value...(void)
The expression | b = ( b = true) | logical value assigned...
if( b = true ) is equivalent to if( b ) base on the expression above....
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-15-2008, 02:25 PM
|
 |
Senior Member
|
|
Join Date: Mar 2008
Location: Delhi, India
Posts: 187
|
|
|
@ SUKOTA
you are absolutely correct if you are talking in 'C' language. But i guess in JAVA is should not compile.
Eranga what's the Answer!
__________________
i am the future
|
|

06-16-2008, 05:26 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
Originally Posted by sukatoa
if( b = true ) is equivalent to if( b ) base on the expression above....
On this, how can I get "b is true", since I set the b to false.
Actually that is not a comparison, it's set to true. This is valid only for boolean expressions. Hence following is not valid,
Most important thing here is, substitution of = for == only valid for boolean variables.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-16-2008, 10:05 AM
|
 |
Senior Member
|
|
Join Date: Mar 2008
Location: Delhi, India
Posts: 187
|
|
|
So Eranga, will the code compile?
what will be the output
__________________
i am the future
|
|

06-16-2008, 10:36 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
Yes my friend, code compile fine.
Output is b is true
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-16-2008, 01:59 PM
|
 |
Senior Member
|
|
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 527
|
|
the subtask of an "if statement" will always executes if that will be the case....
On this, how can I get "b is true", since I set the b to false.
Weither you set b to true or false, the substask will still executes....
if( false ){
System.out.println("b is > B");
}
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-16-2008, 05:31 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
But in my code, scenario is different. Rather than comparison, I used a assignment statement. That's how your explanation valid. 
So your comments is fine.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-28-2008, 08:23 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
Why are you guys keep quite on this thread. I don't So here is another.
Is this class compilable or not? Please don't use any IDE to test before answering.
public class AA {
AA() {
this("Java");
}
AA(String name) {
this();
}
}
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-28-2008, 04:55 PM
|
 |
Senior Member
|
|
Join Date: Mar 2008
Location: Delhi, India
Posts: 187
|
|
i guess it will not compile, [ with no reason  ]
__________________
i am the future
|
|

06-29-2008, 07:09 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
Yes, it's not compile at all. What is the reason to think that it's not compile? 
Reason is recursive constructor calling there and at the you get the stack overflow error. Actually latest VM identified this as a compile time error. But older versions find it as a runtime error. 
Next question.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-30-2008, 09:30 AM
|
|
| | |