is there a JDBC equivalent to Oracle's PRO*C DESCRIBE operation?

T

Thomas Kellerer

shib wrote on 18.09.2006 08:11:
I am porting code from Oracle's PRO*C to JDBC.

In PRO*C, if I have a text which represents an unknown SQL statement, I can
describe it and get the names (and number) of bind variables in it.

For example, describing

SELECT a,b from t where a= :bind1 and b= :bind2

Will return the result of two input bind variables, whose name is :bind1 and
:bind2. I can also get the names & types of the output variables (a & b in
this case).

Is there any JDBC equivalent for this (I know in JDBC binds are represented
as ?, however oracle-specific JDBC drivers also support the above syntax).

Is PreparedStatement.getParameterMetaData() what you are looking for?
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/PreparedStatement.html#getParameterMetaData()

But the last time I tried, the Oracle driver did not implement this...

Thomas
 
S

shib

I am porting code from Oracle's PRO*C to JDBC.

In PRO*C, if I have a text which represents an unknown SQL statement, I can
describe it and get the names (and number) of bind variables in it.

For example, describing

SELECT a,b from t where a= :bind1 and b= :bind2

Will return the result of two input bind variables, whose name is :bind1 and
:bind2. I can also get the names & types of the output variables (a & b in
this case).

Is there any JDBC equivalent for this (I know in JDBC binds are represented
as ?, however oracle-specific JDBC drivers also support the above syntax).

Thanks,
Ilan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,042
Members
48,769
Latest member
Clifft

Latest Threads

Top