• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.sql.SQLException General Error

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

What can be the cause of such exception???

I am getting this when I am fetching data from database (select query) through a java program, but the strange part is that, the same query works perfectly when I run it in SQL prompt...

What can be the reason??

Please help, I am very confuse...

Thanks a lot.

 
Maximilian Xavier Stocker
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rathi ji:

What can be the reason??

It is some syntax problem in your query of some sort but it is impossible to say without seeing it. Please post your Java code where prepare/create/execute this statement.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Maximilian Stocker:

It is some syntax problem in your query of some sort but it is impossible to say without seeing it. Please post your Java code where prepare/create/execute this statement.


But the same query is working fine, when I copy it, paste it into SQL prompt and run it...

How it can be possible...

Thanks.

 
Paul Clapham
Sheriff
Posts: 21558
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because it is nothing to do with the particular SQL query. Every time I have had that error, it is because I did things in the wrong order in my code.

It would certainly be helpful if you posted the code. Or we could sit here and speculate.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Paul Clapham:
Because it is nothing to do with the particular SQL query. Every time I have had that error, it is because I did things in the wrong order in my code.

It would certainly be helpful if you posted the code. Or we could sit here and speculate.


Paul, I don't have code at this time, otherwise I would have posted it before....

Yes, But I am doing everything in right order:
1] Making connection.
2] Making statement.
3] Executing statement.

Everywhere I am following the same sequence and working fine...

You are also right that without code it will only be a guess...

Thanks.

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the reason for this problem:

Actually the table had one clobe field. I don't know, why, but it's was because of this only...


If you will run second query in Java, then it will get a general error.

Please somebody can varify this...

Thanks.


[ December 29, 2005: Message edited by: rathi ji ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic