Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter Type Conflict

Status
Not open for further replies.

NitinJain

Programmer
Jun 28, 2002
18
0
0
IN
Hello,
I have java function which when used executes a stored procedure which inturn returns a VARCHAR value.

The java function:

public String getDocumentName () {
try {
System.out.println("DBDocument getDocumentName() ID : " +super.getId());
System.out.println(" ");
CallableStatement statement = con.prepareCall("{ ? = call getDocumentName (?)}");
statement.registerOutParameter(1,java.sql.Types.VARCHAR);
statement.setLong (1, super.getId());
ResultSet resultSet = statement.executeQuery();
if (!resultSet.next()) {
throw new DBDOMSpException ("SQL Statement");
}
System.out.println("DBDocument getDocumentName() resultSet : ");
System.out.println(" ");
String result = statement.getString (1);
System.out.println("DBDocument getDocumentName() result : " +result);
System.out.println(" ");
resultSet.close();
return result;
} catch (SQLException sqle) {
throw dbDomImplementation.getSqlOrDomException(sqle);
}
}

The stored procedure:

CREATE OR REPLACE FUNCTION getDocumentName (docId NUMBER) RETURN VARCHAR IS

nodeIsDoc BOOLEAN;
result VARCHAR (255);

BEGIN

nodeIsDoc := nodeTypeMatches (docId, 9);

IF NOT nodeIsDoc THEN

DOMException(15);

ELSIF nodeIsDoc IS NULL THEN

raise_application_error (-20205, ' Document does not exists');

ELSE

SELECT name
INTO result
FROM t_Document
WHERE id = docId;

END IF;

RETURN result;

END getDocumentName;

I have checked the value returned by the stored procedure explixitly which looks like this "/home/s0199941/Project/node_in_dtd3.xml".

But the exception of parameter type conflict is thrown.
Can any one suggest something?

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top