Package java.sql

Examples of java.sql.CallableStatement.wasNull()


        assertTrue(op.wasNull());

        op.setBigDecimal(1, new BigDecimal("99"));
        op.execute();
        assertNull(op.getBigDecimal(1));
        assertTrue(op.wasNull());

        op.setString(2, "23.5");
        op.setBigDecimal(1, new BigDecimal("14"));
        op.execute();
        assertEquals("37.50", op.getBigDecimal(1).toString());
View Full Code Here


        op.execute();
        assertEquals("32.50", op.getBigDecimal(1).toString());

        op.execute();
        assertEquals("56.00", op.getBigDecimal(1).toString());
        assertFalse(op.wasNull());

        op.setString(2, "67.99");
        op.setBigDecimal(1, new BigDecimal("32.01"));
        try {
            op.execute();
View Full Code Here

        op.setString(2, "67.99");
        op.setBigDecimal(1, new BigDecimal("32.01"));
        try {
            op.execute();
            fail("FAIL OP4INOUT 32.01+67.99 >" + op.getBigDecimal(1)
                    + "< null ? " + op.wasNull());
        } catch (SQLException sqle) {
            assertSQLState("22003", sqle);
        }

        op.setString(2, "1");
View Full Code Here

        op.setString(2, "1");
        op.setBigDecimal(1, new BigDecimal("102.33"));
        try {
            op.execute();
            fail("FAIL OP4INOUT 1+102.33 >" + op.getBigDecimal(1) + "< null ? "
                    + op.wasNull());
        } catch (SQLException sqle) {
            assertSQLState("22003", sqle);
        }

        // now some checks to requirements for parameter setting.
View Full Code Here

        ptsi.setObject(2, new Integer(3));

        ptsi.execute();
        assertEquals("wrong value for p_inout", "9", ptsi.getObject(2)
                .toString());
        assertFalse(ptsi.wasNull());
        assertEquals("wrong value for p_out", "6", ptsi.getObject(3).toString());
        assertFalse(ptsi.wasNull());

        ptsi.close();
View Full Code Here

        ptsi.execute();
        assertEquals("wrong value for p_inout", "9", ptsi.getObject(2)
                .toString());
        assertFalse(ptsi.wasNull());
        assertEquals("wrong value for p_out", "6", ptsi.getObject(3).toString());
        assertFalse(ptsi.wasNull());

        ptsi.close();

        s.execute("drop procedure PTSMALLINT2");
        s.execute("drop table PT1");
View Full Code Here

        op.registerOutParameter(1, Types.INTEGER);
        op.setInt(2, 7);
        op.execute();

        assertEquals(14, op.getInt(1));
        assertFalse(op.wasNull());

        op.close();

        s.execute("create procedure OP2(inout a int, in b int) " +
            "parameter style java language java " +
View Full Code Here

        cstmt.setNString(7, "sourceName:prefix");
        cstmt.setLong(8, 9999L);
        cstmt.registerOutParameter(9, java.sql.Types.BIGINT);
        expect(cstmt.execute()).andReturn(true);
        expect(cstmt.getLong(9)).andReturn(99L);
        expect(cstmt.wasNull()).andReturn(false);

        expect(connection.prepareCall("{call dbo.uspInsertMetricValue(?, ?, ?)}")).andReturn(cstmt);
        cstmt.setLong(1, 99L);
        cstmt.setNString(2, "name");
        cstmt.setNString(3, "1234");
View Full Code Here

        cstmt.setNString(7, "sourceName:prefix");
        cstmt.setLong(8, 9999L);
        cstmt.registerOutParameter(9, java.sql.Types.BIGINT);
        expect(cstmt.execute()).andReturn(true);
        expect(cstmt.getLong(9)).andReturn(99L);
        expect(cstmt.wasNull()).andReturn(false);

        expect(connection.prepareCall("{call dbo.uspInsertMetricValue(?, ?, ?)}")).andReturn(cstmt);
        cstmt.setLong(1, 99L);
        cstmt.setNString(2, "name");
        cstmt.setNString(3, "1234");
View Full Code Here

    cstmt.setNString(7, "tagPairs");
    cstmt.setLong(8, 9999L);
    cstmt.registerOutParameter(9, java.sql.Types.BIGINT);
    expect(cstmt.execute()).andReturn(true);
    expect(cstmt.getLong(9)).andReturn(99L);
    expect(cstmt.wasNull()).andReturn(false);

    // replay
    replay(configuration, connection, cstmt);

    SqlServerSink sink = createInstance();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.