Hi All,
I ammaking use of the microsoft JDBC driver.
In the SP, in a transaction when a error is encountered --> fatal error (PK violation / incompatible data types) then the control returns to the application abruptly.
the error handling within the SP is not carried out.
Any help on the same is appreciated.
Thanks
Anu
| Thread-Topic: error handling using JDBC DRIVER
| thread-index: AcR1WumpXFxDagmKQe6fJDRWMRkPsQ==
| X-WBNR-Posting-Host: 203.200.17.10
| From: "=?Utf-8?B?QW51cmFkaGE=?=" <Anuradha@.discussions.microsoft.com>
| Subject: error handling using JDBC DRIVER
| Date: Thu, 29 Jul 2004 03:58:00 -0700
| Lines: 15
| Message-ID: <DE5BB305-8AEA-4E26-A84E-F7CDA3A3DA82@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.jdbcdriver
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.jdbcdriver:6213
| X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
|
| Hi All,
|
| I ammaking use of the microsoft JDBC driver.
|
| In the SP, in a transaction when a error is encountered --> fatal error
(PK violation / incompatible data types) then the control returns to the
application abruptly.
|
| the error handling within the SP is not carried out.
|
| Any help on the same is appreciated.
|
| Thanks
| Anu
|
|
|
|
Hello,
Can you provide sample code that demonstrates this problem?
Carb Simien, MCSE MCDBA MCAD
Microsoft Developer Support - Web Data
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
|||Hi @.ll
i have the same-problem
sample code:
SP USER_REGISTER
@.username char(25),@.usershowname char(25), @.useremail
char(100),@.userpasswort varchar(10)
AS
declare @.message varchar(300), @.errno bigint
set @.message='Registrierung wird durchgeführt'
insert into game_user(user_name,user_showname,user_email,user_ passwort)
values(ltrim(rtrim(@.username)),ltrim(rtrim(@.usersh owname)),ltrim(rtrim(@.useremail)),ltrim(rtrim(@.use rpasswort)))
set @.errno = @.@.error
print @.errno
IF @.errno <> 0
BEGIN
if @.errno = 2627
begin
set @.message='Username oder Email-Adresse bereits registriert'
end
END
ELSE
BEGIN
set @.message ='User wurde registriert'
END
select @.message as RESULT
end SP
The application get the errorcode 2627 ....
"Carb Simien [MSFT]" wrote:
> --
> | Thread-Topic: error handling using JDBC DRIVER
> | thread-index: AcR1WumpXFxDagmKQe6fJDRWMRkPsQ==
> | X-WBNR-Posting-Host: 203.200.17.10
> | From: "=?Utf-8?B?QW51cmFkaGE=?=" <Anuradha@.discussions.microsoft.com>
> | Subject: error handling using JDBC DRIVER
> | Date: Thu, 29 Jul 2004 03:58:00 -0700
> | Lines: 15
> | Message-ID: <DE5BB305-8AEA-4E26-A84E-F7CDA3A3DA82@.microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain;
> | charset="Utf-8"
> | Content-Transfer-Encoding: 7bit
> | X-Newsreader: Microsoft CDO for Windows 2000
> | Content-Class: urn:content-classes:message
> | Importance: normal
> | Priority: normal
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | Newsgroups: microsoft.public.sqlserver.jdbcdriver
> | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
> | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.jdbcdriver:6213
> | X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
> |
> | Hi All,
> |
> | I ammaking use of the microsoft JDBC driver.
> |
> | In the SP, in a transaction when a error is encountered --> fatal error
> (PK violation / incompatible data types) then the control returns to the
> application abruptly.
> |
> | the error handling within the SP is not carried out.
> |
> | Any help on the same is appreciated.
> |
> | Thanks
> | Anu
> |
> |
> |
> |
> Hello,
> Can you provide sample code that demonstrates this problem?
> Carb Simien, MCSE MCDBA MCAD
> Microsoft Developer Support - Web Data
> Please reply only to the newsgroups.
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Are you secure? For information about the Strategic Technology Protection
> Program and to order your FREE Security Tool Kit, please visit
> http://www.microsoft.com/security.
>
|||| Thread-Topic: error handling using JDBC DRIVER
| thread-index: AcSfHIJuOFthVFyySJS0yWEV7H5QYg==
| X-WBNR-Posting-Host: 81.223.39.26
| From: "=?Utf-8?B?T25saW5ldGFsay5uZXQ=?="
<Onlinetalk.net@.discussions.microsoft.com>
| References: <DE5BB305-8AEA-4E26-A84E-F7CDA3A3DA82@.microsoft.com>
<nu7#Z1XeEHA.2036@.cpmsftngxa10.phx.gbl>
| Subject: RE: error handling using JDBC DRIVER
| Date: Mon, 20 Sep 2004 07:17:06 -0700
| Lines: 102
| Message-ID: <8E77A45A-DDAB-45E2-BC12-29697F00471D@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 8bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.jdbcdriver
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.jdbcdriver:6281
| X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
|
| Hi @.ll
|
| i have the same-problem
|
| sample code:
|
| SP USER_REGISTER
| @.username char(25),@.usershowname char(25), @.useremail
| char(100),@.userpasswort varchar(10)
| AS
| declare @.message varchar(300), @.errno bigint
|
| set @.message='Registrierung wird durchgeführt'
|
| insert into game_user(user_name,user_showname,user_email,user_ passwort)
values(ltrim(rtrim(@.username)),ltrim(rtrim(@.usersh owname)),ltrim(rtrim(@.user
email)),ltrim(rtrim(@.userpasswort)))
|
| set @.errno = @.@.error
|
| print @.errno
|
| IF @.errno <> 0
| BEGIN
| if @.errno = 2627
| begin
| set @.message='Username oder Email-Adresse bereits registriert'
| end
| END
| ELSE
| BEGIN
|
| set @.message ='User wurde registriert'
| END
|
| select @.message as RESULT
|
| end SP
|
| The application get the errorcode 2627 ....
|
|
| "Carb Simien [MSFT]" wrote:
|
| >
| > --
| > | Thread-Topic: error handling using JDBC DRIVER
| > | thread-index: AcR1WumpXFxDagmKQe6fJDRWMRkPsQ==
| > | X-WBNR-Posting-Host: 203.200.17.10
| > | From: "=?Utf-8?B?QW51cmFkaGE=?=" <Anuradha@.discussions.microsoft.com>
| > | Subject: error handling using JDBC DRIVER
| > | Date: Thu, 29 Jul 2004 03:58:00 -0700
| > | Lines: 15
| > | Message-ID: <DE5BB305-8AEA-4E26-A84E-F7CDA3A3DA82@.microsoft.com>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.sqlserver.jdbcdriver
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| > | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.jdbcdriver:6213
| > | X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
| > |
| > | Hi All,
| > |
| > | I ammaking use of the microsoft JDBC driver.
| > |
| > | In the SP, in a transaction when a error is encountered --> fatal
error
| > (PK violation / incompatible data types) then the control returns to
the
| > application abruptly.
| > |
| > | the error handling within the SP is not carried out.
| > |
| > | Any help on the same is appreciated.
| > |
| > | Thanks
| > | Anu
| > |
| > |
| > |
| > |
| >
| > Hello,
| >
| > Can you provide sample code that demonstrates this problem?
| >
| > Carb Simien, MCSE MCDBA MCAD
| > Microsoft Developer Support - Web Data
| >
| > Please reply only to the newsgroups.
| > This posting is provided "AS IS" with no warranties, and confers no
rights.
| >
| > Are you secure? For information about the Strategic Technology
Protection
| > Program and to order your FREE Security Tool Kit, please visit
| > http://www.microsoft.com/security.
| >
| >
|
If you are using Query Analyzer to execute the stored procedure, then you
will see the remainder of the stored procedure being processed. However,
this is not the case with both JDBC and ODBCTest (direct ODBC API calls).
As a test, I took the stored procedure from this post and added an INSERT
statement immediately after "set @.message='Username oder Email-Adresse
bereits registriert'". What I found is that even though the subsequent
code in the procedure was not shown in the JDBC and ODBCTest code, the
INSERT did, in fact, fire. I don't think you will get the other results
back to the client because the statement has been terminated by that point.
However, the INSERT results can be seen if you check the table after the
fact.
Carb Simien, MCSE MCDBA MCAD
Microsoft Developer Support - Web Data
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
No comments:
Post a Comment