• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.sql.SQLException General Error

 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic