Hi, Sorry, you can't easily do that. Some DBMSes stored procedures
may say they return a result set (cursor) via an output parameter,
and other procedures may opaquely return an arbitrary series of
result sets that can differ based on arguments or the time of day.
You have to know something about the content of the procedure.
Joe Weinstein at BEA Systems.
joeNOSPAM@BEA.com - 21 Jul 2005 20:50 GMT
I neglected to say that even those DBMSes that return a result
set/cursor
as output parameters may also return a different type of result set
depending on arguments or time of day too. Therefore they too cannot
know/report the metadata about the result set they might return.
Therefore, even if you *do* execute the procedure, and obtain the
metadata,
you have no assurance that the next time you execute the procedure,
that the metadata is the same...
Joe Weinstein at BEA Systems
> How do I get the resultset metadata for storedprocedure without
> executing the stored procedure in JDBC?
I've 2 hints for you:
1.st: use Connection.getMetaData().getProcedures(...)
to get information about all procedures of schema
2.nd: after this use Connection.getMetaData().getProcedureColumns(...)
to get information about named procedure.
HTH Alfred
ibondre - 02 Aug 2005 23:57 GMT
That will not return any information about the resultsets.
Irfan.
joeNOSPAM@BEA.com - 03 Aug 2005 01:53 GMT
right. As I said, there is no way for the DBMS to provide the
information. It's too
complicated. One procedure's result sets could depend on other result
sets
from other procedures etc... Im sorry to say that you have to know the
procedure semantics in order to write clients that are sure to be able
to
use the procedures.
Joe Weinstein at BEA