JDK : 6.0-b47
Platform[s] : Sol 10 sparc
switch/Mode : default
DB : ORCL
Failing Test : java_sql_exceptions/exception/exception_002
Description:
===========
From the doc, the reason field is defaults to null with SQLException(java.lang.Throwable cause) constructs. However, I am getting output of reason is same as the getCause(). Unless I didn't use the correct method to print out the reason field. I am using getMessage() to print out the reason field.
java doc
=========
public SQLException(java.lang.Throwable cause)
Constructs a SQLException object with underlying cause; the reason field defaults to null, the SQLState field defaults to null, and the vendorCode field defaults to 0.
How to reproduce:
====================
javac myexpection.java
java myexpection
Test output:
=============
SQLException(throw1) called
Throwable cause is java.lang.Throwable: Cause 1
Throwable reasons is java.lang.Throwable: Cause 1
Throwable sqlState is null
Throwable vendor code is 0
Specific Machine Info:
=====================
SunOS orthello 5.10 Generic sun4u sparc SUNW,Ultra-60
myexpection.java
=================
import java.lang.Exception.*;
import java.sql.*;
import java.io.*;
public class myexpection {
public static void main (String args[]) {
Throwable throw0 = null;
Throwable throw1 = new Throwable("Cause 1");
String reasons = "reasons for SQLEx";
String sqlState = "sqlState for SQLEx";
int myVendorCode = 99999;
try {
throw new SQLException(throw1);
}catch (SQLException sqlEx){
System.out.println("SQLException(throw1) called");
System.out.println("Throwable cause is " + sqlEx.getCause());
System.out.println("Throwable reasons is " + sqlEx.getMessage());
System.out.println("Throwable sqlState is " + sqlEx.getSQLState());
System.out.println("Throwable vendor code is " + sqlEx.getErrorCode());
}
}
}
BatchUpdateException(java.lang.Throwable cause) constructs too.
Platform[s] : Sol 10 sparc
switch/Mode : default
DB : ORCL
Failing Test : java_sql_exceptions/exception/exception_002
Description:
===========
From the doc, the reason field is defaults to null with SQLException(java.lang.Throwable cause) constructs. However, I am getting output of reason is same as the getCause(). Unless I didn't use the correct method to print out the reason field. I am using getMessage() to print out the reason field.
java doc
=========
public SQLException(java.lang.Throwable cause)
Constructs a SQLException object with underlying cause; the reason field defaults to null, the SQLState field defaults to null, and the vendorCode field defaults to 0.
How to reproduce:
====================
javac myexpection.java
java myexpection
Test output:
=============
SQLException(throw1) called
Throwable cause is java.lang.Throwable: Cause 1
Throwable reasons is java.lang.Throwable: Cause 1
Throwable sqlState is null
Throwable vendor code is 0
Specific Machine Info:
=====================
SunOS orthello 5.10 Generic sun4u sparc SUNW,Ultra-60
myexpection.java
=================
import java.lang.Exception.*;
import java.sql.*;
import java.io.*;
public class myexpection {
public static void main (String args[]) {
Throwable throw0 = null;
Throwable throw1 = new Throwable("Cause 1");
String reasons = "reasons for SQLEx";
String sqlState = "sqlState for SQLEx";
int myVendorCode = 99999;
try {
throw new SQLException(throw1);
}catch (SQLException sqlEx){
System.out.println("SQLException(throw1) called");
System.out.println("Throwable cause is " + sqlEx.getCause());
System.out.println("Throwable reasons is " + sqlEx.getMessage());
System.out.println("Throwable sqlState is " + sqlEx.getSQLState());
System.out.println("Throwable vendor code is " + sqlEx.getErrorCode());
}
}
}
BatchUpdateException(java.lang.Throwable cause) constructs too.