Re: getting Multiple resultsets in java using stored procedure in MS SQL Server 2000
- From: Joe Weinstein <joeNOSPAM@xxxxxxx>
- Date: Fri, 03 Mar 2006 08:29:26 -0800
anil wrote:
I have a stored procedure with multiple (two) queries in MS-SQL 2000
Server,
I'm trying to get the resultset in java
like
cStmt = conn.prepareCall("{ call spXXX (?)}");
cStmt.setString(1, val);
What is the variable defined as in the procedure?
What is the column type that the variable is
used to compare to? I suspect you're trying to rely
on the DBMS doing implicit conversion, which it will
do for fresh SQL, but not parameters.
Joe Weinstein at BEA Systems.
boolean result = cStmt.execute();
System.out.println("result:" + result);
if(result)
{
ResultSet rs1 = cStmt.getResultSet();
System.out.println("rs1" + rs1);
while(rs1.next())
{
<process resultset>
}
rs1.close();
boolean result2 = cStmt.getMoreResults();
System.out.println("result2:" + result2);
if(result2)
{
ResultSet rs2 = cStmt.getResultSet();
System.out.println("rs2" + rs2);
while(rs2.next())
{
<process resultset>
}
rs2.close();
}
}
I'm getting the resultset object in java but there are no records in
the resultset, but if i run the same query seperately in the query
analyser, i get the results.
Am I doing anything wrong?
Any help in this regard would be really great. Thank you.
-Anil
.
- Follow-Ups:
- References:
- Prev by Date: Re: getting Multiple resultsets in java using stored procedure in MS SQL Server 2000
- Next by Date: Re: getting Multiple resultsets in java using stored procedure in MS SQL Server 2000
- Previous by thread: Re: getting Multiple resultsets in java using stored procedure in MS SQL Server 2000
- Next by thread: Re: getting Multiple resultsets in java using stored procedure in MS SQL Server 2000
- Index(es):
Relevant Pages
|