Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Oracle 9 JDBC driver & CallableStatements

15 views
Skip to first unread message

Jordan Redner

unread,
Feb 28, 2003, 10:47:38 PM2/28/03
to
Does anyone know how to get

CallableStatement.setString(String, String);

working??

Exception in thread "main" java.sql.SQLException: Unsupported feature
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBEr
ror.java:689)
at oracle.jdbc.driver.OracleCallableStatement.setString(OracleCallableSt
atement.java:1337)
at Test.main(Test.java:105)


code snippet is....
----------------------------------------

...
String upSql = " call packagename.procname (?)";
CallableStatement cs = conn.prepareCall(upSql);
cs.setString("p_clid_id", "1");
...
cs.execute();

-----------------------------------------

I would really like to be able to reference these input and output
parameters by name instead of by position.

cs.setString(int, String) works fine.

How do I set a variable name as an input parameter, then reference the
parameter by name??


Thanks for any help or direction anyone can provide!

-- Jordan Redner

Joseph Weinstein

unread,
Mar 1, 2003, 12:44:49 AM3/1/03
to Jordan Redner
Hi. Believe the driver. It's telling you it doesn't implement the feature,
so you're not going to be able to refer to a parameter by name.

Avi Abrami

unread,
Mar 1, 2003, 7:24:56 AM3/1/03
to
[Joe's top-posted reply re-arranged.]

But in Jordan's case, the error message may be misleading, since
the syntax is wrong -- in the code he has posted.

Jordan, first get the SQL string syntax correct, then see if you
get an error message. I didn't see any mention of the Oracle
version you are using (in your post), so here is a link to the
correct syntax for my version:

http://download-west.oracle.com/docs/cd/A87860_01/doc/java.817/a83724/basic5.htm#1002489

Hope it helps.

Good Luck,
Avi.

Christoph Seidel

unread,
Mar 1, 2003, 7:24:01 AM3/1/03
to
Joseph Weinstein wrote:
> Hi. Believe the driver. It's telling you it doesn't implement the
> feature, so you're not going to be able to refer to a parameter by
> name.

Well, is this spec. compliant?
Is there any driver which supports this?


Christoph Seidel

unread,
Mar 1, 2003, 2:49:26 PM3/1/03
to
Avi Abrami wrote:
> Jordan, first get the SQL string syntax correct, then see if you
> get an error message. I didn't see any mention of the Oracle
> version you are using (in your post), so here is a link to the
> correct syntax for my version:
>
>
http://download-west.oracle.com/docs/cd/A87860_01/doc/java.817/a83724/basic5
.htm#1002489
>
> Hope it helps.
>
> Good Luck,
> Avi.

The OP meant "named parameters" which are part of the API but not
implemented in oracles driver.


Joseph Weinstein

unread,
Mar 1, 2003, 10:26:22 PM3/1/03
to Christoph Seidel

Christoph Seidel wrote:

My guess is that none do, and for some DBMSes, none ever will.
The driver won't ever know how to convert a procedure parameter
name to an index number into the SQL with question marks. The
only hope this feature has of being implemented is if the native wire-level
client-DBMS protocol has a way of sending values with parameter names.
I don't believe Oracle's does, so this will never be implemented for any
driver to oracle, I think.

Joe Weinstein at BEA


Christoph Seidel

unread,
Mar 2, 2003, 8:41:40 AM3/2/03
to

Well, it should be no problem for any driver to find out a name - index
mapping, this is all we need. OLE/DB can do it, jdbc could do it too.


0 new messages