Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection object giving resultset which doesnot match with query when run in anlyzer

 
sameer K
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY)
is used to run the query same query gives some results but in java application it is returning false on resultset.next() also results are returned properly we use createStatement() i.e no parameters.
what may be the problem?
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what database/jdbc driver team are you using? What is the query? what is the java code?
 
sameer K
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
query is simple 'select * from Employee' this query returns some results in SQL query analyzer. but when run in servlet using createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY) results in no rows (Resultset.next() is false) but returns some results if resultSet is obtained through statement created from createStatement() method.
what is the problem?
 
sameer K
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry, i forgot to provide following info
driver= sun.jdbc.odbc.JdbcOdbcDriver
db=MSSQL 2000
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic