Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Problem with ParameterMetaData

  Asked By: Madison    Date: Jul 12    Category: Java    Views: 732
  

i have a requirement in which i will send one string to preparestatement
function which in turn substitute some value to it... and execute
in this case for each statement.. i don't want to write setString or setFloat
etc,...
my sample code look like this ....

String str="{? = call getEname(?)}"
CallableStatement cs = dbConnection.prepareCall(str);
cs.setInt(2,7369);
cs.registerOutParameter(1,Types.VARCHAR);
cs.execute();
cs.getString(1);

if there are few parameters we can solve this... but what if the parameter
increases....
so what i thought is to use ParameterMetaData. this is in jdk1.4.
when i used this ParameterMetaData it's giving an error...

ParameterMetaData pmd= cs.getParameterMetaData();

Exception is...

java.sql.SQLException: Unsupported feature

i also downloaded oracle driver for it...

Specification-Title: "Oracle JDBC driver classes for use with JDK1.4"
Specification-Version: "Oracle JDBC Driver version - 9.0.2.0.0"
Specification-Vendor: "Oracle Corporation" .
Implementation-Title: "ojdbc14.jar"
Implementation-Version: "Oracle JDBC Driver version - 9.0.2.0.0"
Implementation-Vendor: "Oracle Corporation"
Implementation-Time: "Wed Feb 19 15:32:24 2003"

i am using Oracle 9i Release 2(9.2)

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Problem with ParameterMetaData Or get search suggestion and latest updates.