Package java.sql

Examples of java.sql.SQLDataException


    /**
     * @test java.sql.SQLDataException(String, Throwable)
     */
    public void test_Constructor_LStringLThrowable() {
        Throwable cause = new Exception("MYTHROWABLE");
        SQLDataException sQLDataException = new SQLDataException(
                "MYTESTSTRING", cause);
        assertNotNull(sQLDataException);
        assertEquals(
                "The reason of SQLDataException set and get should be equivalent",
                "MYTESTSTRING", sQLDataException.getMessage());
        assertNull("The SQLState of SQLDataException should be null",
                sQLDataException.getSQLState());
        assertEquals("The error code of SQLDataException should be 0",
                sQLDataException.getErrorCode(), 0);
        assertEquals(
                "The cause of SQLDataException set and get should be equivalent",
                cause, sQLDataException.getCause());
    }
View Full Code Here


    /**
     * @test java.sql.SQLDataException(String, Throwable)
     */
    public void test_Constructor_LStringLThrowable_1() {
        SQLDataException sQLDataException = new SQLDataException(
                "MYTESTSTRING", (Throwable) null);
        assertNotNull(sQLDataException);
        assertEquals(
                "The reason of SQLDataException set and get should be equivalent",
                "MYTESTSTRING", sQLDataException.getMessage());
        assertNull("The SQLState of SQLDataException should be null",
                sQLDataException.getSQLState());
        assertEquals("The error code of SQLDataException should be 0",
                sQLDataException.getErrorCode(), 0);
        assertNull("The cause of SQLDataException should be null",
                sQLDataException.getCause());
    }
View Full Code Here

* @author Thomas Risberg
*/
public class SQLExceptionSubclassFactory {

  public static SQLException newSQLDataException(String reason, String SQLState, int vendorCode) {
    return new SQLDataException(reason, SQLState, vendorCode);
  }
View Full Code Here

                // (permanently) closed or broken
                return new SQLNonTransientConnectionException(msg, sqlstate,
                        code, cause);
            }
        } else if (sqlstate.startsWith("22")) {
            return new SQLDataException(msg, sqlstate, code, cause);
        } else if (sqlstate.startsWith("23")) {
            return new SQLIntegrityConstraintViolationException(msg, sqlstate,
                    code, cause);
        } else if (sqlstate.startsWith("28")) {
            return new SQLInvalidAuthorizationSpecException(msg, sqlstate,
View Full Code Here

TOP

Related Classes of java.sql.SQLDataException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.