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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lots of spaces in JDBC calls :-) !!

Status
Not open for further replies.

drkestrel

MIS
Sep 25, 2000
439
GB
I have something like the following to use JDBC Connection to call a PL/SQL proceudre on Oracle 8i.

Code:
sCall.setString(MyConstant.STOREPROCEDURE_PARAM_CRITERION, Criterion);
sCall = jdbcConnection.prepareCall(???);

sCall.registerOutParameter(MyConstant.STOREPROCEDURE_PARAM_CODE, Types.CHAR);          
    		sCall.registerOutParameter(MyConstant.STOREPROCEDURE_PARAM_DESCR, Types.VARCHAR);         		

sCall.executeQuery();

result1   = sCall.getString(STOREPROCEDURE_PARAM_CODE);
result2   = sCall.getString(STOREPROCEDURE_PARAM_DESCR);
The problem is with the CHAR field, when char is not null, then result1 becomes something like 32K of spaces!!
when it is null, it is fine!

Anyone know what is wrong please?
 
To be perfectly honest... I don't think it anything to do with java. I use JDBC and Oracle all the time at work. In my experience Oracle is the one that tends to give weird stuff back. I hope this helped! ;-)
- Casey Winans
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top