Search in sources :

Example 16 with SQLFeatureNotSupportedException

use of java.sql.SQLFeatureNotSupportedException in project jdk8u_jdk by JetBrains.

the class SQLFeatureNotSupportedExceptionTests method test8.

/**
     * Create SQLFeatureNotSupportedException with null Throwable
     */
@Test
public void test8() {
    SQLFeatureNotSupportedException ex = new SQLFeatureNotSupportedException((Throwable) null);
    assertTrue(ex.getMessage() == null && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
Also used : SQLFeatureNotSupportedException(java.sql.SQLFeatureNotSupportedException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 17 with SQLFeatureNotSupportedException

use of java.sql.SQLFeatureNotSupportedException in project jdk8u_jdk by JetBrains.

the class SQLFeatureNotSupportedExceptionTests method test1.

/**
     * Create SQLFeatureNotSupportedException with no-arg constructor
     */
@Test
public void test1() {
    SQLFeatureNotSupportedException ex = new SQLFeatureNotSupportedException();
    assertTrue(ex.getMessage() == null && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
Also used : SQLFeatureNotSupportedException(java.sql.SQLFeatureNotSupportedException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 18 with SQLFeatureNotSupportedException

use of java.sql.SQLFeatureNotSupportedException in project jdk8u_jdk by JetBrains.

the class SQLFeatureNotSupportedExceptionTests method test10.

/**
     * Serialize a SQLFeatureNotSupportedException and make sure you can read it back properly
     */
@Test
public void test10() throws Exception {
    SQLFeatureNotSupportedException e = new SQLFeatureNotSupportedException(reason, state, errorCode, t);
    SQLFeatureNotSupportedException ex1 = createSerializedException(e);
    assertTrue(reason.equals(ex1.getMessage()) && ex1.getSQLState().equals(state) && cause.equals(ex1.getCause().toString()) && ex1.getErrorCode() == errorCode);
}
Also used : SQLFeatureNotSupportedException(java.sql.SQLFeatureNotSupportedException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 19 with SQLFeatureNotSupportedException

use of java.sql.SQLFeatureNotSupportedException in project jdk8u_jdk by JetBrains.

the class SQLFeatureNotSupportedExceptionTests method test12.

/**
     * Validate that the ordering of the returned Exceptions is correct
     * using traditional while loop
     */
@Test
public void test12() {
    SQLFeatureNotSupportedException ex = new SQLFeatureNotSupportedException("Exception 1", t1);
    SQLFeatureNotSupportedException ex1 = new SQLFeatureNotSupportedException("Exception 2");
    SQLFeatureNotSupportedException ex2 = new SQLFeatureNotSupportedException("Exception 3", t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    SQLException sqe = ex;
    while (sqe != null) {
        assertTrue(msgs[num++].equals(sqe.getMessage()));
        Throwable c = sqe.getCause();
        while (c != null) {
            assertTrue(msgs[num++].equals(c.getMessage()));
            c = c.getCause();
        }
        sqe = sqe.getNextException();
    }
}
Also used : SQLFeatureNotSupportedException(java.sql.SQLFeatureNotSupportedException) SQLException(java.sql.SQLException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 20 with SQLFeatureNotSupportedException

use of java.sql.SQLFeatureNotSupportedException in project jdk8u_jdk by JetBrains.

the class SQLFeatureNotSupportedExceptionTests method test2.

/**
     * Create SQLFeatureNotSupportedException with message
     */
@Test
public void test2() {
    SQLFeatureNotSupportedException ex = new SQLFeatureNotSupportedException(reason);
    assertTrue(ex.getMessage().equals(reason) && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
Also used : SQLFeatureNotSupportedException(java.sql.SQLFeatureNotSupportedException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Aggregations

SQLFeatureNotSupportedException (java.sql.SQLFeatureNotSupportedException)55 SQLException (java.sql.SQLException)20 Connection (java.sql.Connection)14 Test (org.testng.annotations.Test)14 BaseTest (util.BaseTest)14 PreparedStatement (java.sql.PreparedStatement)13 Statement (java.sql.Statement)11 ResultSet (java.sql.ResultSet)10 Test (org.junit.Test)5 Properties (java.util.Properties)4 CallableStatement (java.sql.CallableStatement)3 DruidPooledCallableStatement (com.alibaba.druid.pool.DruidPooledCallableStatement)2 DruidPooledResultSet (com.alibaba.druid.pool.DruidPooledResultSet)2 DruidPooledStatement (com.alibaba.druid.pool.DruidPooledStatement)2 Date (java.sql.Date)2 SQLDataException (java.sql.SQLDataException)2 Savepoint (java.sql.Savepoint)2 Vector (java.util.Vector)2 ColumnInfo (org.apache.jena.jdbc.results.metadata.columns.ColumnInfo)2 SparqlColumnInfo (org.apache.jena.jdbc.results.metadata.columns.SparqlColumnInfo)2