Consultor Eletrônico



Kbase P37962: Correct syntax for accessing the DhSQLException.getDiagnosti
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   19/08/2003
Status: Unverified

GOAL:

Correct syntax for accessing the DhSQLException.getDiagnostics arguments RETURNED_SQLSTATE and MESSAGE_TEXT.

FACT(s) (Environment):

Progress 9.x

FIX:

The following is a skeleton of a Java stored procedure that demonstrates the correct syntax to accessing the RETURNED_SQLSTATE and MESSAGE_TEXT arguments of the DhSQLException.getDiagnostics class:

CREATE PROCEDURE mysp()
IMPORT
import java.sql.*;
BEGIN
try
{
SQLIStatement insertcustomer = new SQLIStatement ("INSERT INTO pub.customer (CustNum) VALUES ('1')") ;
}
catch ( DhSQLException e)
{
String errstate = e.getDiagnostics(DhSQLException .RETURNED_SQLSTATE) ;
String errmesg = e.getDiagnostics (DhSQLException .MESSAGE_TEXT) ;
.
.
.
}
END