Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Result

 
sreenivas vemula
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

problem : I am getting the empty result set. I am trying to get the data base connection from the file PropertyFileReader using jndi lookup as follows.

In somefile.properties file I have defined the property as
dataSourceJNDI_id=jdbc/secondarydb_xxxxx

I have tested whether connection object is null or not. it is not null
tested the stored procedure executing directly in DB, its working.
Checked whether the parameters are getting assigned to callable statement by printing the values, its passing correctly.
Not able to find out the issue.
PLease help

Regards,
sreeni.
 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there isn't much we can tell from the snippett you have provided, but try doing a very simple selelct "select count(*) from some_table" that you know has data in it, is that working?

is this "call storedprocedurename(aram1,param2,param3)" how you typed it into the database to check it? do you need the call statement?

you haven't even told us which database you are working on
 
Rob Spoor
Sheriff
Pie
Posts: 20751
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm missing a printout of parameter3. Are you sure that's correct too?
 
Koen Aerts
Ranch Hand
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you take the parameter values and stick then in the query from the stored procedure and then run it yourself, does it get any rows back? Sounds like a simple case of simply no matching rows.
 
sreenivas vemula
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does it makes difference in running the stored procedure and running a query in a database as I am getting the results when I execute the stored procedure. The issue is when I try to run the stored procedure from the application its returning a empty result set.


 
Rob Spoor
Sheriff
Pie
Posts: 20751
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your stored procedure by any change do more than one query? If so you shouldn't just check the first result but all of them. I've had this problem once too, when I had a stored procedure (in SQL Server 2005) with multiple queries. Checking the ResultSet only checked the first one, and the rest was ignored. An example of how to read all results:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic