/**
* Get the java.sql.SQLWarning for this SqlWarning
*/
public SQLWarning getSQLWarning()
{
SQLWarning sqlw = new SQLWarning(getMessage(), getSQLState(),
getErrorCode());
// If we're in a runtime that supports chained exceptions, set the cause
// of the SQLWarning to be this SqlWarning.
if (JVMInfo.JDK_ID >= JVMInfo.J2SE_14 )
{
sqlw.initCause(this);
}
// Set up the nextException chain
if ( nextWarning_ != null )
{
// The exception chain gets constructed automatically through
// the beautiful power of recursion
//
// We have to use the right method to convert the next exception
// depending upon its type. Luckily with all the other subclasses
// of SQLException we don't have to make our own matching
// subclasses because
sqlw.setNextException(
nextException_ instanceof SqlWarning ?
((SqlWarning)nextException_).getSQLWarning() :
nextException_.getSQLException());
}