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

exception while calling stored procedure in SQL server

0 views
Skip to first unread message

Jun Li

unread,
Nov 10, 2004, 1:21:04 PM11/10/04
to
Hi,

I run into a problem while calling a proc in SQL server. I am using a database control to do so. The proc returns a integer. This is the first time I use SQL server. Any thoughts? Thanks in advance.

My method call is:
int createAccount(SQLParameter[] param)
The sql is:
{call espsiCompany(?, ?, ?)}

The error is:

java.lang.NullPointerException
at com.bea.wlw.runtime.core.control.DatabaseControlImpl.getStatement_v2(DatabaseControlImpl.jcs:1885)
at com.bea.wlw.runtime.core.control.DatabaseControlImpl.invoke(DatabaseControlImpl.jcs:2691)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:373)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:396)
at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:388)
at services.OnyxDBControl.createAccount(OnyxDBControl.ctrl)
at services.OnyxDBControlTest.createAccount(OnyxDBControlTest.jws:18)

Joe Weinstein

unread,
Nov 10, 2004, 3:22:24 PM11/10/04
to
Hi. Show me the procedure text. (at least the declaration)
thanks
Joe

Jun Li

unread,
Nov 11, 2004, 1:50:05 PM11/11/04
to
Here you go. Thanks for your time.

DECLARE @RC int
DECLARE @iSiteId int
DECLARE @iCompanyId int
DECLARE @chLanguageCode char(4)
DECLARE @vchAssignedId varchar(255)
DECLARE @vchCompanyName varchar(255)
DECLARE @vchAddress1 varchar(255)
DECLARE @vchAddress2 varchar(255)
DECLARE @vchAddress3 varchar(255)
DECLARE @vchCity varchar(255)
DECLARE @chRegionCode char(4)
DECLARE @chCountryCode char(4)
DECLARE @vchPostCode varchar(40)
DECLARE @vchPhoneNumber varchar(40)
DECLARE @vchEmailAddress varchar(255)
DECLARE @vchURL varchar(255)
DECLARE @iCompanyTypeCode int
DECLARE @iCompanySubTypeCode int
DECLARE @iFamilyId int
DECLARE @iParentId int
DECLARE @iPrimaryContactId int
DECLARE @vchContactFirstName varchar(255)
DECLARE @vchContactLastName varchar(255)
DECLARE @iDivisionCode int
DECLARE @iSICCode int
DECLARE @iMarketSector int
DECLARE @vchTaxId varchar(255)
DECLARE @vchDunnsNumber varchar(255)
DECLARE @iPhoneTypeId int
DECLARE @iAddressTypeId int
DECLARE @iSourceId int
DECLARE @iStatusId int
DECLARE @bValidAddress tinyint
DECLARE @iAccessCode int
DECLARE @bPrivate tinyint
DECLARE @vchUser1 varchar(255)
DECLARE @vchUser2 varchar(255)
DECLARE @vchUser3 varchar(255)
DECLARE @vchUser4 varchar(255)
DECLARE @vchUser5 varchar(255)
DECLARE @vchUser6 varchar(255)
DECLARE @vchUser7 varchar(255)
DECLARE @vchUser8 varchar(255)
DECLARE @vchUser9 varchar(255)
DECLARE @vchUser10 varchar(255)
DECLARE @chInsertBy char(10)
DECLARE @dtInsertDate datetime
DECLARE @tiLockRecord tinyint
DECLARE @tiRecordStatus tinyint
DECLARE @tireturnType tinyint

-- Set parameter values
EXEC @RC = [ONYXPROD].[dbo].[espsiCompany] @iSiteId, @iCompanyId OUTPUT , @chLanguageCode, @vchAssignedId, @vchCompanyName, @vchAddress1, @vchAddress2, @vchAddress3, @vchCity, @chRegionCode, @chCountryCode, @vchPostCode, @vchPhoneNumber, @vchEmailAddress, @vchURL, @iCompanyTypeCode, @iCompanySubTypeCode, @iFamilyId, @iParentId, @iPrimaryContactId, @vchContactFirstName, @vchContactLastName, @iDivisionCode, @iSICCode, @iMarketSector, @vchTaxId, @vchDunnsNumber, @iPhoneTypeId, @iAddressTypeId, @iSourceId, @iStatusId, @bValidAddress, @iAccessCode, @bPrivate, @vchUser1, @vchUser2, @vchUser3, @vchUser4, @vchUser5, @vchUser6, @vchUser7, @vchUser8, @vchUser9, @vchUser10, @chInsertBy, @dtInsertDate, @tiLockRecord, @tiRecordStatus, @tireturnType

Joe Weinstein

unread,
Nov 11, 2004, 2:01:05 PM11/11/04
to

Hi. That's not the signature of the procedure. What I'd like to see is
the SQL used to create the procedure, eg:

create procedure myProc @foo int, @bar varchar(30) ....
as
begin
...
end

pradeep tiwari

unread,
Dec 6, 2004, 12:22:01 PM12/6/04
to
Hi
Usually we get the NullpointerException when we try to call a method on the object reference without creating the object.So in your code try to find out the statement where you are trying to call the methods.I thik you are not creating object but calling the menthod.
0 new messages