I'm wondering if it's possible to use ADO Errors in Java.

I'm looking at some ASP code that uses ADO for Errors, I believe I've converted it to JAVA.

Is it possible to even do or is there better error handling in Java?

I'm familiar with using a try catch block, but I'm not sure how to incorporate all the errors into one.

There are about 10 different errors, I cut them out for this question and just left a few errors for this question

Snippet of ASP Code:

If Err.number <> 0 Then
    Response.Write("<!-- ADO Errors Begin -->" & vbCrLf)
        For each objError in con_duns_sdo2.Errors
            Response.Write("<!-- ADO Error.Number = " & objError.Number & "-->" & vbCrLf)
            Response.Write("<!-- ADO Error.Description = " & objError.Description & "-->" & vbCrLf)
            Response.Write("<!-- ADO Errors End -->" & vbCrLf)
            Response.Write("<!-- VBScript Errors Begin -->" & vbCrLf)

Snippet of Java that I'm trying to convert:

for (objError : con_currency_sdo) {
                    if (con_currency_sdo.Errors == "true") {
                         System.out.println("ADO Error.Number" + objError.Number + "\r\n");
                         System.out.println("ADO Error.Description" + objError.Description + "\r\n");

                         System.out.println("ADO Errors End" + "\r\n");
                         System.out.println("VBScript Errors Begin" + "\r\n");

Related posts

Recent Viewed