Package java.sql

Examples of java.sql.CallableStatement.wasNull()


    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(true);

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

    SqlServerSink sink = createInstance();
View Full Code Here


      cStmt.setInt(3, 1);
      cStmt.setInt(4, 1);

      assertFalse(cStmt.execute());
      assertEquals(0f, cStmt.getInt(1), .001);
      assertEquals(true, cStmt.wasNull());
      assertEquals(null, cStmt.getObject(1));
      assertEquals(true, cStmt.wasNull());

      assertEquals(-1, cStmt.executeUpdate());
      assertEquals(0f, cStmt.getInt(1), .001);
View Full Code Here

      assertFalse(cStmt.execute());
      assertEquals(0f, cStmt.getInt(1), .001);
      assertEquals(true, cStmt.wasNull());
      assertEquals(null, cStmt.getObject(1));
      assertEquals(true, cStmt.wasNull());

      assertEquals(-1, cStmt.executeUpdate());
      assertEquals(0f, cStmt.getInt(1), .001);
      assertEquals(true, cStmt.wasNull());
      assertEquals(null, cStmt.getObject(1));
View Full Code Here

      assertEquals(null, cStmt.getObject(1));
      assertEquals(true, cStmt.wasNull());

      assertEquals(-1, cStmt.executeUpdate());
      assertEquals(0f, cStmt.getInt(1), .001);
      assertEquals(true, cStmt.wasNull());
      assertEquals(null, cStmt.getObject(1));
      assertEquals(true, cStmt.wasNull());

      // Check with literals, not all parameters filled!
      cStmt = this.conn.prepareCall("{? = CALL testBug10310(4,5,?)}");
View Full Code Here

      assertEquals(-1, cStmt.executeUpdate());
      assertEquals(0f, cStmt.getInt(1), .001);
      assertEquals(true, cStmt.wasNull());
      assertEquals(null, cStmt.getObject(1));
      assertEquals(true, cStmt.wasNull());

      // Check with literals, not all parameters filled!
      cStmt = this.conn.prepareCall("{? = CALL testBug10310(4,5,?)}");
      cStmt.registerOutParameter(1, Types.INTEGER);
      cStmt.setInt(2, 1);
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

        op.registerOutParameter(1, Types.INTEGER);
        op.setInt(1, 3);
        op.setInt(2, 7);
        op.execute();
        assertEquals(17, op.getInt(1));
        assertFalse(op.wasNull());
        op.close();

        // inout & out procedures with variable length
        s.execute(
            "create procedure OP3(inout a char(10), in b int) " +
View Full Code Here

        op.registerOutParameter(1, Types.CHAR);
        op.setString(1, "dan");
        op.setInt(2, 8);
        op.execute();
        assertEquals("nad       ", op.getString(1));
        assertFalse(op.wasNull());
        op.close();

        // inout & out DECIMAL procedures with variable length
        s.execute(
            "create procedure OP4(out a DECIMAL(4,2), in b varchar(255)) " +
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.