当前位置: 首页>>代码示例>>Java>>正文


Java SerialException类代码示例

本文整理汇总了Java中javax.sql.rowset.serial.SerialException的典型用法代码示例。如果您正苦于以下问题:Java SerialException类的具体用法?Java SerialException怎么用?Java SerialException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SerialException类属于javax.sql.rowset.serial包,在下文中一共展示了SerialException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: test04

import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test
public void test04() {
    SQLException ex = new SerialException("Exception 1");
    ex.initCause(t1);
    SerialException ex1 = new SerialException("Exception 2");
    SerialException ex2 = new SerialException("Exception 3");
    ex2.initCause(t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    while (ex != null) {
        assertTrue(msgs[num++].equals(ex.getMessage()));
        Throwable c = ex.getCause();
        while (c != null) {
            assertTrue(msgs[num++].equals(c.getMessage()));
            c = c.getCause();
        }
        ex = ex.getNextException();
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:21,代码来源:SerialExceptionTests.java

示例2: test01

import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test
public void test01() {
    SerialException ex = new SerialException();
    assertTrue(ex.getMessage() == null
            && ex.getSQLState() == null
            && ex.getCause() == null
            && ex.getErrorCode() == 0);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:SerialExceptionTests.java

示例3: test03

import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test
public void test03() {
    SerialException ex = new SerialException("Exception 1");
    ex.initCause(t1);
    SerialException ex1 = new SerialException("Exception 2");
    SerialException ex2 = new SerialException("Exception 3");
    ex2.initCause(t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:SerialExceptionTests.java

示例4: test05

import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test
public void test05() throws Exception {
    SerialException e = new SerialException(reason);
    SerialException ex1 = createSerializedException(e);
    assertTrue(ex1.getMessage().equals(reason)
            && ex1.getSQLState() == null
            && ex1.getCause() == null
            && ex1.getErrorCode() == 0);;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:10,代码来源:SerialExceptionTests.java

示例5: test02

import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test
public void test02() throws Exception {
    SerialException e = new SerialException();
    SerialJavaObject sjo = new SerialJavaObject(e);
    Field[] f = e.getClass().getFields();
    assertTrue(Arrays.equals(f, sjo.getFields()));
    assertFalse(Arrays.equals("hello".getClass().getFields(),
            sjo.getFields()));
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:10,代码来源:SerialJavaObjectTests.java

示例6: test19

import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test19() throws Exception {
    SerialBlob sb = new SerialBlob(bytes);
    sb.free();
    SerialBlob sb2 = (SerialBlob) sb.clone();
    InputStream is = sb2.getBinaryStream(1, 3);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:8,代码来源:SerialBlobTests.java

示例7: main

import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    SerialClob clob = new SerialClob(new char[0]);
    try {
        clob.setCharacterStream(0);
    } catch (SerialException e) {
         System.out.println("Test PASSED");
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:SetCharacterStream.java

示例8: main

import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    SerialClob clob = new SerialClob(new char[0]);
    try {
        clob.setAsciiStream(0);
    } catch (SerialException e) {
         System.out.println("Test PASSED");
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:SetAsciiStream.java

示例9: main

import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    SerialBlob blob = new SerialBlob(new byte[0]);
    try {
        blob.setBinaryStream(0);
    } catch (SerialException e) {
        System.out.println("Test PASSED");
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:SetBinaryStream.java

示例10: test02

import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test
public void test02() {
    SerialException ex = new SerialException(reason);
    assertTrue(ex.getMessage().equals(reason)
            && ex.getSQLState() == null
            && ex.getCause() == null
            && ex.getErrorCode() == 0);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:SerialExceptionTests.java

示例11: test03

import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test03() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.getResultSet();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:6,代码来源:SerialArrayTests.java

示例12: test21

import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test21() throws Exception {
    SerialBlob sb = new SerialBlob(bytes);
    sb.setBinaryStream(3);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:SerialBlobTests.java

示例13: test05

import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test05() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.getResultSet(1, 1);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:6,代码来源:SerialArrayTests.java

示例14: test09

import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test09() throws Exception {
    SerialBlob sb = new SerialBlob(new StubBlob());
    sb.free();
    sb.setBytes(1, new byte[10], 0, 5);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:7,代码来源:SerialBlobTests.java

示例15: test07

import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test07() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.free();
    sa.getArray();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:7,代码来源:SerialArrayTests.java


注:本文中的javax.sql.rowset.serial.SerialException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。