× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Thanks Buck you solved the error but unfortunately not the problem. I also
appreciate the explanation of how you got there - I have tucked that one
away for future reference.

Perhaps you may have a suggestion on if this is possible or not.

The MS SQL SP does as per the snipped sample below.

Is there a way to retrieve the returned value of 1 or 2 ?

It is not a result set so getResultSet returns noting, I have now tried
getUpdateCount and it returns -1. I do not know what else to try ???

<begin_snip>
USE [History]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[details]
@BookingID int,
@OperatorID int
AS
BEGIN
declare @BookingLookup int
declare @OperatorLookup int

set @BookingLookup = (select BookingID from History.dbo.Booking
where BookingID = @BookingID)

set @OperatorLookup = (select OperatorID from History.dbo.Booking
TB with (nolock)

if @BookingLookup is null
begin
print 'Booking does not exist'
return 1
end

else if @OperatorLookup <> @OperatorID

begin
print 'You are not authorised'
return 2
end

else

begin

select TB.BookingID as [Booking ID],
<end_snip>



Don Brown






From: "Buck Calabro" <kc2hiz@xxxxxxxxx>
To: midrange-l@xxxxxxxxxxxx
Date: 12/10/2018 01:30 AM
Subject: Re: JDBCR4 where no result set returned
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



On 10/11/2018 1:39 AM, Don Brown wrote:

I am using jtds-1.2.5.jar

The error indicates the method does not exist.

Java exception "java.lang.NoSuchMethodError:
java/sql/Statement.getUpdatecount()I" when calling method
"getUpdatecount"
with signature "()I" in class "java.sql.Statement".

Java is not my strong suit and I am having trouble in searching the
available methods in the classes in that jar file.

I can list the classes but I do not know how to link a class to a java
definition Eg the procedure is specifying the
getUpdatecount method in what I thought was class java.sql.Statement but
I
can't see that class in the jtds-1.2.5.jar file.

What am I missing or not understanding ?

Any assistance appreciated.

P JDBC_getUpdateCount...
P b Export
D JDBC_getUpdateCount...
D pi 10i 0
D stmt Like(Statement) const
D getUpdateCount pr 10i 0 extproc(*JAVA
D : 'java.sql.Statement'
D : 'getUpdatecount')
c return getUpdateCount(stmt)
P E
The above prototype is looking for a method called 'getUpdatecount'.
TL;DR - it's spelt wrong. Use 'getUpdateCount'. Java is case sensitive.


How did I get there from here?
First, I started with the prototype.
It's in a class called 'java.sql'Statement'.

Because it starts with 'java.sql' I can see that this is from the
'java.sql' class. The JTDS classes all begin 'net.sourceforge.jtds'.
So off I go looking for the Javadoc for the class 'java.sql.Statement'.
I searched the web for 'java.sql javadoc' and got:
https://docs.oracle.com/javase/8/docs/api/java/sql/package-summary.html

That looks like the right place. Now that I have the 'java.sql' API, I
need to go to the 'Statement' class. (I wish there were a better way to
talk about this stuff.)
https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html

Searching the page (Ctrl-F) for 'getupdate' I can see there's a
'getUpdateCount()' with an upper case C. That returns an int - which the
RPG prototype does, so aside from the issue of incorrect case, that code
should be good to go.

--
--buck

http://wiki.midrange.com
Your updates make it better!

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.