Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

A TabularResults.ResultSet+JDBC driver problem

3 posts in General Discussion (old) Last posting was on 2000-03-17 21:51:17.0Z
Jorge Luzarraga C. Posted on 2000-03-17 17:39:11.0Z
Newsgroups: sybase.public.easerver
From: "Jorge Luzarraga C." <jluzarra@alboradasystems.com>
Subject: A TabularResults.ResultSet+JDBC driver problem
Date: Fri, 17 Mar 2000 12:39:11 -0500
Lines: 128
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: 209.170.68.205
Message-ID: <347_xCq9DuDk$GA.201@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26183
Article PK: 156853

Hello,

I have a very weird problem about a TabularResults.ResultSet returned from a
Java Component that is connected through a JDBC Driver(weblogic) to a
MSSqlserver database. I invoke the component from a powerdynamo script, here
it is:

<html>

<head>
<title>Alborada Systems-Proceso de Tarificación</title>
</head>

<body bgcolor="#FFFFFF">
<p align="center"><a href="http://www.alboradasystems.com"><img
src="images/logo2.gif" alt="Alborada Systems" border="0" WIDTH="510"
HEIGHT="80"></a></p>
<!--SCRIPT
listaTarifas =
java.CreateComponent("alborada/Tarificar","iiop://192.168.0.19:9000",
"jagadmin","","alborada/Tarificar");
if ( listaTarifas != null ){
RecordSet = listaTarifas.test();
query = java.CallStaticMethod("com.sybase.CORBA.jdbc11.SQL",
"getResultSet",RecordSet );
received = query.next();
document.writeln(received);
i = 0;
while ( received ){
metadata = query.getMetaData();
document.writeln("*********<BR>");
columns = metadata.getColumnCount();
document.writeln(columns);
for( j=1; j <= columns; j++){
value = query.getString(j);
document.writeln( value );
}
received = query.next();
i++;
}
}
else{
document.writeln("No se pudo crear el componente deseado<BR>");
document.writeln(site.GetErrorInfo()+"<BR>");
}
-->
</body>
</html>

but the var received is false, I don't know why if I've executed the stored
procedure that is inside the component an return a resultset like this:

codprd descprd
------ --------------------------------------------------
044 AMPLIA AUTOS RESIDENTES
045 AMPLIA AUTOS RESIDENTES
046 LIMITADA AUTOS RESIDENTES
047 BASICO AUTOS RESIDENTES

What could it be?

Here is my jaguar log:

Mar 17 12:59:10 2000: Authentication timeout period is 3600 seconds.
Note: authentication timeout can be disabled.
Mar 17 12:59:10 2000: Authentication lockout period is 600 seconds.
Note: authentication lockout can be disabled.
Mar 17 12:59:10 2000: powersoft.powerj.db.java_sql.Transaction: logging
enabled
Mar 17 12:59:10 2000: powersoft.powerj.db.java_sql.Transaction:
[Tarificar.transaction_1 in setName] new name is 'Tarificar.transaction_1',
now registered in the global name table
Mar 17 12:59:10 2000: powersoft.powerj.db.java_sql.Transaction:
[Tarificar.transaction_1 in setLoginTimeout] setting timeout to infinite
timeout
Mar 17 12:59:10 2000: powersoft.powerj.db.java_sql.Transaction:
[Tarificar.transaction_1 in addQuery] adding query 'Tarificar.query_1'
Mar 17 12:59:10 2000: powersoft.powerj.db.java_sql.Transaction:
[Tarificar.transaction_1 in connect] getting connection using URL=
Mar 17 12:59:10 2000: powersoft.powerj.db.java_sql.Transaction:
[Tarificar.transaction_1 in connect] using a Jaguar connection source,
setting TryAgain to false
Mar 17 12:59:10 2000: powersoft.powerj.db.java_sql.Transaction:
[Tarificar.transaction_1 in obtainConnection] obtaining connection using
connection source
Mar 17 12:59:10 2000: powersoft.powerj.db.java_sql.Transaction:
[Tarificar.transaction_1 in obtainConnection] obtaining Jaguar named
connection cache 'weblogic'
Mar 17 12:59:10 2000: powersoft.powerj.db.java_sql.Transaction:
[Tarificar.transaction_1 in obtainConnection] obtaining connection from the
cache using JCM_WAIT flag
Mar 17 12:59:11 2000: powersoft.powerj.db.java_sql.Transaction:
[Tarificar.transaction_1 in obtainConnection] connection source returned a
valid connection
Mar 17 12:59:11 2000: powersoft.powerj.db.java_sql.Transaction:
[Tarificar.transaction_1 in connect] Automatically detecting driver type,
set the DriverType property to avoid autodetection
Mar 17 12:59:11 2000: powersoft.powerj.db.java_sql.Transaction:
[Tarificar.transaction_1 in connect] Automatically detecting database type,
set the DatabaseType property to avoid autodetection
Mar 17 12:59:11 2000: powersoft.powerj.db.java_sql.Transaction:
[Tarificar.transaction_1 in connect] Guessing database type based on driver
type
Mar 17 12:59:11 2000: powersoft.powerj.db.java_sql.Transaction:
[Tarificar.transaction_1 in connect] Connected to database type
DATABASE_OTHER (unknown) using driver type DRIVER_OTHER (unknown)
Mar 17 12:59:11 2000: powersoft.powerj.db.java_sql.Transaction:
[Tarificar.transaction_1 in connect] connection successful
Mar 17 12:59:11 2000: powersoft.powerj.db.java_sql.Transaction:
[Tarificar.transaction_1 in notifyQueries] notifying all query objects of
connection status change
Mar 17 12:59:11 2000: powersoft.powerj.db.java_sql.Transaction:
[Tarificar.transaction_1 in createCallableStatement] creating JDBC
CallableStatement object for '{call
sp_web_tarifica(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) }'
Mar 17 12:59:11 2000: Unable to execute retrieve
Mar 17 12:59:11 2000: TRACE: alborada/Tarificar/test: 1000 ms, 108 bytes in,
24 bytes out (jagadmin@192.168.0.19)




Ing. Jorge Luzarraga C.
Analista de Sistemas
Alborada Systems, S.A.
www.alboradasystems.com


Jorge Luzarraga C. Posted on 2000-03-17 19:32:24.0Z
Newsgroups: sybase.public.easerver
From: "Jorge Luzarraga C." <jluzarra@alboradasystems.com>
Subject: Re: A TabularResults.ResultSet+JDBC driver problem
Date: Fri, 17 Mar 2000 14:32:24 -0500
Lines: 153
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: 209.170.68.205
Message-ID: <347_DjKHVtEk$GA.34@forums.sybase.com>
References: <347_xCq9DuDk$GA.201@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26165
Article PK: 156843

I have an additional element to add here. I've discovered that this problem
has something to do with the sp. My sp handles several cursors and a local
temporary table where I insert the results during the execution of the sp,
so my last sentence is to select this table to show the result set.

Here is my sp:

create procedure sp_web_tarifica
@RAMO CHAR(2), /* Ramo de los productos */
@TIPVEH CHAR, /* Tipo de Vehículo */
@FECHA DATETIME = NULL, /* LA FECHA DEL DIA */
@CLASE CHAR(1) = NULL, /* CLASE DEL VEHICULO */
@FAB CHAR(3) = NULL, /* FABRICANTE */
@SEC SMALLINT = 1, /* SECUENCIAL */
--@VALORSA FLOAT=NULL, /* EL VALOR DE LA SUMA ASEGURADA (ANIO) */
--@VALOR_NUEVO FLOAT=NULL, /* EL VALOR DE COMPRA */
--@PRODUCTO CHAR(3)= NULL, /* CODIGO DEL PRODUCTO */
--@COBERTURA CHAR (7)= NULL, /* CODIGO DE LA COBERTURA POR PRODUCTO */
@CODIGO_POSTAL CHAR(12)=NULL, /* CODIGO POSTAL DEL ASEGURADO PRINCIPAL */
@SEC_DEDUC SMALLINT=NULL, /* SECUENCIAL DEL DEDUCIBLE APLICADO (0=SIN
DED.)*/
@COD_GARAGE CHAR(2)=NULL, /* CODIGO DEL GARAGE 00=SI 01=NO*/
@TIEMPO SMALLINT=NULL, /* TIEMPO DE VIGENCIA DE LA POLIZA */
@FACMCAR FLOAT, /* FACTOR POR MULTICOBERTURA PREVIAMENTE CALCULADO */
@PRIMART FLOAT, /* PRIMA PARA CALCULO DE COB. INFLACIONARIA */
@COD_BOL CHAR(2)='00', /* SI TIENE O NO BOLSAS DE AIRE */
@TONELAJE CHAR(1)='0', /* TONELAJE DEL VEHICULO 00000 ES EL FACTOR
PARA NO APLICAR TONELAJE */
@SERVICIO CHAR(5)=NULL, /* TIPO DE SERVICIO DEL VEHICULO */
@ZONA_CIRCU CHAR(5)='00000', /* ZONA DE CIRCULACION DEL VEHICULO */
@USO CHAR(3)=NULL, /* USO DEL VEHICULO */
@RIESGO_CARGA CHAR(5)=NULL, /* RIEGO DE PELIGROSIDAD DE LA CARGA QUE SE
TRANSPORTA */
@LOCAL_FORA CHAR(1)=NULL, /* DETERMINA SI EL VEHICULO ES PARA CARGAS
LOCALES O FORANEAS */
@REMOL_SN CHAR(1)=NULL, /* DETERMINA EL NUMERO DE REMOLQUE N, 1, 2, 3 */
@TIP_SA CHAR(2)='00', /* ES EL TIPO DE LA SUMA ASEGURADA 00 COMERCIAL
01 CONTRATADO
02 FACTURA
*/
@DESCUENTOS CHAR(1)='N', /* FLAG QUE NOS INDICA SI ES EL ENDOSO DE
DISMINUCION DE PRIMA */
@POR_DESCUENTO FLOAT=0.00, /* VALOR DEL DESCUENTO EN PORCENTAJES */
@WPRIMA FLOAT=NULL, /* LA PRIMA YA CALCULADAD PARA EL DESCUENTO */
@WPRIMAA FLOAT=NULL, /* LA PRIMA ANUAL YA CALCULADA PARA EL DESCUENTO */
@FEC_INI DATETIME, /* FECHA DE INICIO DE VIGENCIA DE LA COTIZACION */
@FEC_FIN DATETIME, /* FECHA DE FIN DE VIGENCIA DE LA COTIZACION */
@ANIO INT /* ANO DE FABRICACION */
AS
declare @valorsa float
declare @codramo char(2)
declare @tipoveh char
declare @codprd char(3)
declare @codcob char(7)
declare @valor_prima float
declare @valor_prima_anual float
declare @descprd varchar(80)
declare @valor_nuevo float
declare @grupo char(3)
declare @prima_ac float
declare @prima_anual_ac float
declare @vm_cobert float

select @grupo = '049'
select @valorsa = 0

--Creamos la tabla temporal que contendrá las tarifas por producto
create table #tarxprd(
codprd char(3),
descprd varchar(50),
prima money,
primanual money)

--Obtenemos el valor a nuevo del vehículo seleccionado
exec sp_web_get_vpre @clase, @fab, @sec,@grupo,@fecha, @valor_nuevo output

--Declaramos el cursor para los todos los productos disponibles
--según el ramo y tipo vehículo

declare cur_prd cursor for
SELECT PF_RAMO, PF_TIPO, PF_CODIGO
FROM TB_SEG_PRD_FILTER
WHERE PF_RAMO = @RAMO
AND PF_TIPO = ISNULL(@TIPVEH,PF_TIPO)
ORDER BY PF_CODIGO


OPEN cur_prd
FETCH cur_prd INTO @codramo, @tipoveh, @codprd



-- Tarificamos para cada producto dentro del cursor
WHILE (@@FETCH_STATUS = 0)
BEGIN
--Declaramos el cursor para todas las coberturas disponibles
--según el producto y ramo
declare cur_cob cursor for
select cpr_cod_cob, cpr_vm_sa
from tb_seg_cobxprd
where prd_ramo =@codramo and
prd_cod = @codprd

open cur_cob
fetch cur_cob into @codcob, @vm_cobert
select @codcob= @ramo+@codcob
-- select @codcob
while (@@fetch_status = 0)
begin
if (@codcob <> '00013')
begin
if (@codcob <> '00018')
select @valorsa = @vm_cobert
else
select @valorsa = 0
end
exec csa.sp_web_parm_tarifica
@fecha,@clase,@fab,@sec,@valorsa,@valor_nuevo,@codprd,@codcob,

@codigo_postal,@sec_deduc,@cod_garage,@tiempo,@facmcar,@primart,@cod_bol,@to
nelaje,
@servicio,
@zona_circu,@uso,@riesgo_carga,@local_fora,@remol_sn,@tip_sa,@descuentos,
@por_descuento,@wprima,@wprimaa,@fec_ini,@fec_fin,@anio,@valor_prima
output,
@valor_prima_anual output

select @prima_ac = @prima_ac + @valor_prima
select @prima_anual_ac = @prima_anual_ac + @valor_prima_anual
fetch cur_cob into @codcob,@vm_cobert
end
close cur_cob
deallocate cur_cob

select @descprd=prd_descrip
from tb_seg_prd
where prd_ramo=@ramo and
prd_codigo=@codprd

insert into #tarxprd
values(@codprd,@descprd,@prima_ac,@prima_anual_ac)

FETCH cur_prd INTO @codramo, @tipoveh, @codprd
END
CLOSE cur_prd
DEALLOCATE cur_prd



select codprd,descprd from #tarxprd


Jorge Luzarraga C. Posted on 2000-03-17 21:51:17.0Z
Newsgroups: sybase.public.easerver
From: "Jorge Luzarraga C." <jluzarra@alboradasystems.com>
Subject: Re: A TabularResults.ResultSet+JDBC driver problem
Date: Fri, 17 Mar 2000 16:51:17 -0500
Lines: 164
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: 209.170.68.205
Message-ID: <347_vchz86Fk$GA.111@forums.sybase.com>
References: <347_xCq9DuDk$GA.201@forums.sybase.com> <347_DjKHVtEk$GA.34@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26153
Article PK: 156830

Like I said before the problem was the sp . A temporary table that didn't
accept null values so what I did is to redefine the create table statement .

Sorry about wasting your time.

Jorge Luzarraga C. <jluzarra@alboradasystems.com> wrote in message
news:DjKHVtEk$GA.34@forums.sybase.com...
> I have an additional element to add here. I've discovered that this
problem
> has something to do with the sp. My sp handles several cursors and a local
> temporary table where I insert the results during the execution of the sp,
> so my last sentence is to select this table to show the result set.
>
> Here is my sp:
>
> create procedure sp_web_tarifica
> @RAMO CHAR(2), /* Ramo de los productos */
> @TIPVEH CHAR, /* Tipo de Vehículo */
> @FECHA DATETIME = NULL, /* LA FECHA DEL DIA */
> @CLASE CHAR(1) = NULL, /* CLASE DEL VEHICULO */
> @FAB CHAR(3) = NULL, /* FABRICANTE */
> @SEC SMALLINT = 1, /* SECUENCIAL */
> --@VALORSA FLOAT=NULL, /* EL VALOR DE LA SUMA ASEGURADA (ANIO) */
> --@VALOR_NUEVO FLOAT=NULL, /* EL VALOR DE COMPRA */
> --@PRODUCTO CHAR(3)= NULL, /* CODIGO DEL PRODUCTO */
> --@COBERTURA CHAR (7)= NULL, /* CODIGO DE LA COBERTURA POR PRODUCTO */
> @CODIGO_POSTAL CHAR(12)=NULL, /* CODIGO POSTAL DEL ASEGURADO PRINCIPAL
*/
> @SEC_DEDUC SMALLINT=NULL, /* SECUENCIAL DEL DEDUCIBLE APLICADO (0=SIN
> DED.)*/
> @COD_GARAGE CHAR(2)=NULL, /* CODIGO DEL GARAGE 00=SI 01=NO*/
> @TIEMPO SMALLINT=NULL, /* TIEMPO DE VIGENCIA DE LA POLIZA */
> @FACMCAR FLOAT, /* FACTOR POR MULTICOBERTURA PREVIAMENTE CALCULADO */
> @PRIMART FLOAT, /* PRIMA PARA CALCULO DE COB. INFLACIONARIA */
> @COD_BOL CHAR(2)='00', /* SI TIENE O NO BOLSAS DE AIRE */
> @TONELAJE CHAR(1)='0', /* TONELAJE DEL VEHICULO 00000 ES EL FACTOR
> PARA NO APLICAR TONELAJE */
> @SERVICIO CHAR(5)=NULL, /* TIPO DE SERVICIO DEL VEHICULO */
> @ZONA_CIRCU CHAR(5)='00000', /* ZONA DE CIRCULACION DEL VEHICULO */
> @USO CHAR(3)=NULL, /* USO DEL VEHICULO */
> @RIESGO_CARGA CHAR(5)=NULL, /* RIEGO DE PELIGROSIDAD DE LA CARGA QUE SE
> TRANSPORTA */
> @LOCAL_FORA CHAR(1)=NULL, /* DETERMINA SI EL VEHICULO ES PARA CARGAS
> LOCALES O FORANEAS */
> @REMOL_SN CHAR(1)=NULL, /* DETERMINA EL NUMERO DE REMOLQUE N, 1, 2, 3 */
> @TIP_SA CHAR(2)='00', /* ES EL TIPO DE LA SUMA ASEGURADA 00 COMERCIAL
> 01 CONTRATADO
> 02 FACTURA
> */
> @DESCUENTOS CHAR(1)='N', /* FLAG QUE NOS INDICA SI ES EL ENDOSO DE
> DISMINUCION DE PRIMA */
> @POR_DESCUENTO FLOAT=0.00, /* VALOR DEL DESCUENTO EN PORCENTAJES */
> @WPRIMA FLOAT=NULL, /* LA PRIMA YA CALCULADAD PARA EL DESCUENTO */
> @WPRIMAA FLOAT=NULL, /* LA PRIMA ANUAL YA CALCULADA PARA EL DESCUENTO */
> @FEC_INI DATETIME, /* FECHA DE INICIO DE VIGENCIA DE LA COTIZACION */
> @FEC_FIN DATETIME, /* FECHA DE FIN DE VIGENCIA DE LA COTIZACION */
> @ANIO INT /* ANO DE FABRICACION */
> AS
> declare @valorsa float
> declare @codramo char(2)
> declare @tipoveh char
> declare @codprd char(3)
> declare @codcob char(7)
> declare @valor_prima float
> declare @valor_prima_anual float
> declare @descprd varchar(80)
> declare @valor_nuevo float
> declare @grupo char(3)
> declare @prima_ac float
> declare @prima_anual_ac float
> declare @vm_cobert float
>
> select @grupo = '049'
> select @valorsa = 0
>
> --Creamos la tabla temporal que contendrá las tarifas por producto
> create table #tarxprd(
> codprd char(3),
> descprd varchar(50),
> prima money,
> primanual money)
>
> --Obtenemos el valor a nuevo del vehículo seleccionado
> exec sp_web_get_vpre @clase, @fab, @sec,@grupo,@fecha, @valor_nuevo output
>
> --Declaramos el cursor para los todos los productos disponibles
> --según el ramo y tipo vehículo
>
> declare cur_prd cursor for
> SELECT PF_RAMO, PF_TIPO, PF_CODIGO
> FROM TB_SEG_PRD_FILTER
> WHERE PF_RAMO = @RAMO
> AND PF_TIPO = ISNULL(@TIPVEH,PF_TIPO)
> ORDER BY PF_CODIGO
>
>
> OPEN cur_prd
> FETCH cur_prd INTO @codramo, @tipoveh, @codprd
>
>
>
> -- Tarificamos para cada producto dentro del cursor
> WHILE (@@FETCH_STATUS = 0)
> BEGIN
> --Declaramos el cursor para todas las coberturas disponibles
> --según el producto y ramo
> declare cur_cob cursor for
> select cpr_cod_cob, cpr_vm_sa
> from tb_seg_cobxprd
> where prd_ramo =@codramo and
> prd_cod = @codprd
>
> open cur_cob
> fetch cur_cob into @codcob, @vm_cobert
> select @codcob= @ramo+@codcob
> -- select @codcob
> while (@@fetch_status = 0)
> begin
> if (@codcob <> '00013')
> begin
> if (@codcob <> '00018')
> select @valorsa = @vm_cobert
> else
> select @valorsa = 0
> end
> exec csa.sp_web_parm_tarifica
> @fecha,@clase,@fab,@sec,@valorsa,@valor_nuevo,@codprd,@codcob,
>
>
@codigo_postal,@sec_deduc,@cod_garage,@tiempo,@facmcar,@primart,@cod_bol,@to
> nelaje,
> @servicio,
> @zona_circu,@uso,@riesgo_carga,@local_fora,@remol_sn,@tip_sa,@descuentos,
> @por_descuento,@wprima,@wprimaa,@fec_ini,@fec_fin,@anio,@valor_prima
> output,
> @valor_prima_anual output
>
> select @prima_ac = @prima_ac + @valor_prima
> select @prima_anual_ac = @prima_anual_ac + @valor_prima_anual
> fetch cur_cob into @codcob,@vm_cobert
> end
> close cur_cob
> deallocate cur_cob
>
> select @descprd=prd_descrip
> from tb_seg_prd
> where prd_ramo=@ramo and
> prd_codigo=@codprd
>
> insert into #tarxprd
> values(@codprd,@descprd,@prima_ac,@prima_anual_ac)
>
> FETCH cur_prd INTO @codramo, @tipoveh, @codprd
> END
> CLOSE cur_prd
> DEALLOCATE cur_prd
>
>
>
> select codprd,descprd from #tarxprd
>
>
>