The ResultSet.next() returns false....
Hai,
I am working on jdbc. The connection credentials all correct, and its getting connected to the sybase without any problems. But I am not able to perform any 'select' or "update" statements...There are no exception or any errors...But the ResultSet.next() returns false and executeUpdate returns 0 . .
I think you can help me.....Thanks...
[364 byte] By [
2569a] at [2007-11-27 2:36:31]

# 2
But the same query gives results , in the database environment(sybase)
The 'conditions' ,query structure all are the same. I have checked this with two methods in jdbc ie executeQuery() and prepareStatement(),but both these methods don't retreive any values from the tables..........
I think u can answer this porblem.....Kindly expect your consideration
2569a at 2007-7-12 2:55:52 >

# 6
When you catch and ignore them. That is one of the reasons we want to see your code. The other is, is that you are probably creating the query "piecemeal" i.e. "string" + var + "string" + ..... and. many times, people forget a space in at least one of those strings, and then also catch, and ignore, exceptions, and then complain about exactly the type of thing you are complaing about here.
Try printing out the query directly before executing it, and then copy and paste that query into your db tool and see what it produces, then.
# 8
> Yes the query is same
As already pointed out, there are ONLY two possibilities.
1. The query is not the same
2. The database is not the same.
You are making assumptions about what is going on and then drawing conclusions.
You need to understand that you assumptions are wrong. So it doesn't matter what conclusion you draw.
In terms of why the query isn't the same there could be any number of reasons but usually it is because you are passing in data and that data isn't what you think (assume) it is. It can also be that you are constructing the SQL and that construction is different. It could be that the environment that you use to test as settings which impact SQL.