@Test
public void testSqlError() throws SQLException {

    
    JDBCConnection jdbcConn = new JDBCConnection(mockConn, true);
    SQLException ex = new SQLException("sql-reason", "08S01", 9999);
    ResourceException rEx = (ResourceException) jdbcConn.sqlError(ex, "sqlError");
    assertEquals(ResourceException.CONFLICT, rEx.getCode());
    
    ex = new SQLException("sql-reason", "40001", 9999);
    rEx = (ResourceException) jdbcConn.sqlError(ex, "sqlError");
    assertEquals(ResourceException.CONFLICT, rEx.getCode());
    
    ex = new SQLException("sql-reason", "sql-state", 1290);
    rEx = (ResourceException) jdbcConn.sqlError(ex, "sqlError");
    assertEquals(ResourceException.GONE, rEx.getCode());
    
    ex = new SQLException("sql-reason", "sql-state", 1062);
    rEx = (ResourceException) jdbcConn.sqlError(ex, "sqlError");
    assertEquals(ResourceException.BAD_REQUEST, rEx.getCode());
    ex = new SQLTimeoutException("sql-reason", "sql-state", 1001);
    rEx = (ResourceException) jdbcConn.sqlError(ex, "sqlError");
    assertEquals(ResourceException.SERVICE_UNAVAILABLE, rEx.getCode());
    jdbcConn.close();
}