aspose file tools
The moose likes JDBC and the fly likes java.sql.SQLException General Error Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "java.sql.SQLException General Error" Watch "java.sql.SQLException General Error" New topic
Author

java.sql.SQLException General Error

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3829
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

Joined: Sep 20, 2005
Posts: 381
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

Joined: Oct 11, 2004
Posts: 3829
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
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

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

Joined: Oct 11, 2004
Posts: 3829
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

Joined: Oct 11, 2004
Posts: 3829
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.sql.SQLException General Error
 
Similar Threads
Empty URL redirection issue in jsp
Hibernate- why my query results are caching?
Statement and PreparedStatement
Cancel JDBC Connection when Browser Cancel
SQLException -- urgent help needed