Yesterday I made a post about JDBC returning different results from SQL+
Today, I found that in addition to the difference in results between JDBC and SQL+, there is a case that SQL+ is returnning an error : "ORA-01652 Unable to extend temp segment by 128 in tablespace TEMP"
I'm guessing PAY_COSTS_V is a view? Views need to be stored in the temp tablespace, and it look like you may be running out of room in there (or possibly you have no rights to extend the allocated room). It could be that from the time you ran the query in SQLPlus and via JDBC something else freed up space in the temp table space?
What happens if you run the test the other way round? Do you get the error in JDBC and a zero coun in SQLPlus?
Either way, the fix is you need to review what space is available. Its also worth remembering that SQLPlus does more than your average SQL client application, so you can't always expect exactly the same behaviour as you would via JDBC. Try using the JDBC backed client Oracle provide instead.
Yes. PAY_COSTS_V is a view. But I would expect Java application would give me an error or something not to show that the view has no records!!!
I'd expect the same. JDBC is supposed to return the error message the underlying database engine generates wrapped in a SQLException. My only guess (and its very definately a guess) is that SQLPlus does something more than JDBC does. Can you show us your code?
I am using ojdbc14.jar downloaded from Oracle website for the same Oracle version. Do you recommend something else?
Thats the JDBC driver. There are newer versions you can use (always a good idea), but I was talking about the JDBC client oracle provides; SQL Developer I think is called.
Joined: Nov 08, 2008
Here is my code:
Anyway, I used Oracle SQL Deveoper, which uses ojdbc5.jar it gives the result as my Java code. However, executing the same query using SQL Plus, gives Error!
[Dave - removed DB credentials] [ November 12, 2008: Message edited by: David O'Meara ]