Thanks Scott - I have now tried that and get a java error.
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
I have listed the class from that jar below.
jar tf /QIBM/UserData/Java400/ext/jtds-1.2.5.jar
META-INF/
META-INF/MANIFEST.MF
net/
net/sourceforge/
net/sourceforge/jtds/
net/sourceforge/jtds/jdbc/
net/sourceforge/jtds/jdbc/cache/
net/sourceforge/jtds/jdbcx/
net/sourceforge/jtds/jdbcx/proxy/
net/sourceforge/jtds/ssl/
net/sourceforge/jtds/test/
net/sourceforge/jtds/util/
net/sourceforge/jtds/jdbc/BlobImpl.class
net/sourceforge/jtds/jdbc/CachedResultSet.class
net/sourceforge/jtds/jdbc/CharsetInfo$1.class
net/sourceforge/jtds/jdbc/CharsetInfo.class
net/sourceforge/jtds/jdbc/Charsets.properties
net/sourceforge/jtds/jdbc/ClobImpl.class
net/sourceforge/jtds/jdbc/ColInfo.class
net/sourceforge/jtds/jdbc/ConnectionJDBC2$1.class
net/sourceforge/jtds/jdbc/ConnectionJDBC2.class
net/sourceforge/jtds/jdbc/ConnectionJDBC3.class
net/sourceforge/jtds/jdbc/DateTime$1.class
net/sourceforge/jtds/jdbc/DateTime.class
net/sourceforge/jtds/jdbc/DefaultProperties.class
net/sourceforge/jtds/jdbc/Driver.class
net/sourceforge/jtds/jdbc/JtdsCallableStatement.class
net/sourceforge/jtds/jdbc/JtdsDatabaseMetaData.class
net/sourceforge/jtds/jdbc/JtdsPreparedStatement.class
net/sourceforge/jtds/jdbc/JtdsResultSet.class
net/sourceforge/jtds/jdbc/JtdsResultSetMetaData.class
net/sourceforge/jtds/jdbc/JtdsStatement.class
net/sourceforge/jtds/jdbc/MSCursorResultSet.class
net/sourceforge/jtds/jdbc/MSSqlServerInfo.class
net/sourceforge/jtds/jdbc/Messages.class
net/sourceforge/jtds/jdbc/Messages.properties
net/sourceforge/jtds/jdbc/NtlmAuth.class
net/sourceforge/jtds/jdbc/ParamInfo.class
net/sourceforge/jtds/jdbc/ParameterMetaDataImpl.class
net/sourceforge/jtds/jdbc/ProcEntry.class
net/sourceforge/jtds/jdbc/ProtocolException.class
net/sourceforge/jtds/jdbc/RequestStream.class
net/sourceforge/jtds/jdbc/ResponseStream$TdsInputStream.class
net/sourceforge/jtds/jdbc/ResponseStream.class
net/sourceforge/jtds/jdbc/SQLDiagnostic.class
net/sourceforge/jtds/jdbc/SQLParser$CachedSQLQuery.class
net/sourceforge/jtds/jdbc/SQLParser.class
net/sourceforge/jtds/jdbc/SavepointImpl.class
net/sourceforge/jtds/jdbc/Semaphore.class
net/sourceforge/jtds/jdbc/SharedLocalNamedPipe.class
net/sourceforge/jtds/jdbc/SharedNamedPipe.class
net/sourceforge/jtds/jdbc/SharedSocket$VirtualSocket.class
net/sourceforge/jtds/jdbc/SharedSocket.class
net/sourceforge/jtds/jdbc/Support$1.class
net/sourceforge/jtds/jdbc/Support.class
net/sourceforge/jtds/jdbc/TdsCore$1.class
net/sourceforge/jtds/jdbc/TdsCore$TableMetaData.class
net/sourceforge/jtds/jdbc/TdsCore$TdsToken.class
net/sourceforge/jtds/jdbc/TdsCore.class
net/sourceforge/jtds/jdbc/TdsData$TypeInfo.class
net/sourceforge/jtds/jdbc/TdsData.class
net/sourceforge/jtds/jdbc/TypeInfo.class
net/sourceforge/jtds/jdbc/UniqueIdentifier.class
net/sourceforge/jtds/jdbc/XASupport.class
net/sourceforge/jtds/jdbc/cache/ProcedureCache$CacheEntry.class
net/sourceforge/jtds/jdbc/cache/ProcedureCache.class
net/sourceforge/jtds/jdbc/cache/SQLCacheKey.class
net/sourceforge/jtds/jdbc/cache/SimpleLRUCache.class
net/sourceforge/jtds/jdbc/cache/StatementCache.class
net/sourceforge/jtds/jdbcx/JtdsDataSource.class
net/sourceforge/jtds/jdbcx/JtdsObjectFactory.class
net/sourceforge/jtds/jdbcx/JtdsXAConnection.class
net/sourceforge/jtds/jdbcx/JtdsXAResource.class
net/sourceforge/jtds/jdbcx/JtdsXid.class
net/sourceforge/jtds/jdbcx/PooledConnection.class
net/sourceforge/jtds/jdbcx/proxy/CallableStatementProxy.class
net/sourceforge/jtds/jdbcx/proxy/ConnectionProxy.class
net/sourceforge/jtds/jdbcx/proxy/PreparedStatementProxy.class
net/sourceforge/jtds/jdbcx/proxy/StatementProxy.class
net/sourceforge/jtds/ssl/SocketFactories$1.class
net/sourceforge/jtds/ssl/SocketFactories$TdsTlsSocketFactory.class
net/sourceforge/jtds/ssl/SocketFactories.class
net/sourceforge/jtds/ssl/SocketFactoriesSUN$1.class
net/sourceforge/jtds/ssl/SocketFactoriesSUN$TdsTlsSocketFactory.class
net/sourceforge/jtds/ssl/SocketFactoriesSUN.class
net/sourceforge/jtds/ssl/Ssl.class
net/sourceforge/jtds/ssl/TdsTlsInputStream.class
net/sourceforge/jtds/ssl/TdsTlsOutputStream.class
net/sourceforge/jtds/ssl/TdsTlsSocket.class
net/sourceforge/jtds/util/BlobBuffer$AsciiInputStream.class
net/sourceforge/jtds/util/BlobBuffer$AsciiOutputStream.class
net/sourceforge/jtds/util/BlobBuffer$BlobInputStream.class
net/sourceforge/jtds/util/BlobBuffer$BlobOutputStream.class
net/sourceforge/jtds/util/BlobBuffer$UnicodeInputStream.class
net/sourceforge/jtds/util/BlobBuffer.class
net/sourceforge/jtds/util/DESEngine.class
net/sourceforge/jtds/util/GeneralDigest.class
net/sourceforge/jtds/util/Logger.class
net/sourceforge/jtds/util/MD4Digest.class
net/sourceforge/jtds/util/MD5Digest.class
net/sourceforge/jtds/util/SSPIJNIClient.class
net/sourceforge/jtds/util/TimerThread$TimerListener.class
net/sourceforge/jtds/util/TimerThread$TimerRequest.class
net/sourceforge/jtds/util/TimerThread.class
$
Don Brown
From: "Scott Klement" <midrange-l@xxxxxxxxxxxxxxxx>
To: midrange-l@xxxxxxxxxxxx
Date: 09/10/2018 07:36 PM
Subject: Re: JDBCR4 where no result set returned
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
Hi Don,
Sorry about that, the routine to get more results is called
JDBC_getMoreResults() (not JDBC_moreResults). This is just a mistake in
the comments.
Having said that... it's not clear to me why you're asking about this.
You've already determined that there aren't any more results... that's
what it means if JDBC_ExecCall returns '0' -- there aren't any result
sets to retrieve. You would only call JDBC_getMoreResults() for a
stored procedure that returns two or more result sets... the
JDBC_execCall() would tell you about the first one, and
JDBC_getMoreResults() would tell you if there are more (and move the
read cursor to the next one).
If you look at the code for your procedure, it does not appear to return
any result set when there's an error. The result set comes from the
select statement at the bottom -- and if it returns 1 or 2, it never
reaches that select statement. So, there is no result set to retrieve.
If you're looking to get the number 1 or 2, that's not a result set.
Try calling JDBC_getUpdateCount().
--
Scott Klement
http://www.scottklement.com
On 10/8/18 5:43 PM, Don Brown wrote:
I am using SK's JDBCR4 service program to retrieve date from a MS SQL
Server.
Below is a stored procedure that validity checks the passed parameters
and
returns if either the details do not exist or the requester is not
authorised.
If the tests are passed the procedure returns the data set correctly.
Only when the procedure determines there is a problem and returns using
the
"return 1" I do not receive any result set.
I am using isResultSet = JDBC_execCall( prepStmt );
This returns a 0 (isResultSet = 0)
The documentation in the JDBCR4 has the following;
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* JDBC_ExecCall(): Execute SQL statement that calls a stored
* procedure
*
* call = (input) callable statement to execute
*
* Returns *ON if first result is a ResultSet
* or *OFF if first result is an update count
*
* Use JDBC_moreResults(), JDBC_getUpdateCount() and
* JDBC_getResultSet() to get results of this function
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The referenced procedure JDBC_moreResults() does not exist in the JDBCR4
version I have - and I am not sure if that is what I need to us or not.
I am hoping that someone has come across this situation and can advise a
way to receive the returned value ?
Here is a snipet of the stored procedure ...
<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
--
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.