The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Help me PLEASE!!!

Posted by Eric Chow on November 21, 2001 at 4:33 PM

From memory it goes like this:

String balString = request.getParameter ("balance");

// more code here, other strings are retrieved from the form.

Double balance = Double.parseDouble (balString);

// more code here

CallableStatement statement;
statement = con.prepareCall ("{call Pkg_Account.Insert_Sav_Acct (?,?,?,?,?,?,?)}");

// some code here

statement.setDouble (5, balance);

// more code


My PL/SQL code header looks like this. This is in the Pkg_Account package in Oracle:

procedure Insert_Sav_Acct (Employee_ID in char, emp_pw in varchar2, Customer_ID in char, Branch_ID in char, balance in number, ID_Insert out char, outcode out number)

Employee_ID and emp_pw represent authorization required to insert into the table Sav_Acct. Customer_ID and branch_Id are referential keys in that same table. Balance is the balance, and the variable I think is causing the most problems. ID_Insert returns the ID code for the account generated, and outcode is the error code that is generated if there is any errors. If none, outcode := 0.

> Sounds like a casting problem, maybe. Can you provide a snippet of code?

> - mfg

> > Hi there.

> > While trying to use a CallableStatement to insert a double into a PL/SQL procedure containing a number parameter, I get the above error: can bind a LONG value only for insert into a LONG column. I am using JSDK 1.3.0 with Tomcat 3.2. It was mentioned in your archives that this is a container configuration error. Where can I fix this?

> > Thanks.
> > Eric


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us