Package java.sql

Examples of java.sql.Ref


                case 11:{Date v=rs.getDate(col);o=v; break;}
                case 12:{double v=rs.getDouble(col);o=new Double(v);break;}
                case 13:{float v=rs.getFloat(col);o=new Float(v);break;}
                case 14:{int v=rs.getInt(col);o=new Integer(v);break;}
                case 15:{long v=rs.getLong(col);o=new Long(v);break;}
                case 16:{Ref v=rs.getRef(col);o=v;break;}
                case 17:{short v=rs.getShort(col);o=new Short(v);break;}
                case 18:{String v=rs.getString(col);o=v;break;}
                case 19:{Time v=rs.getTime(col);o=v;break;}
                case 20:{Timestamp v=rs.getTimestamp(col);o=v;break;}
//        case 21:{URL v=rs.getURL(col);o=v;break;}
                default: return null;
            }
            // fixup if it contains classname (remove "random" part after @)
            String v = o.toString();
            if (v.indexOf('@') != -1) { // non standard java object.
                s += "Object'   \t: "+prettyType(o);
            } else {
                // default stringifier...
                s += "'"+v+"'    \t: "+o.getClass().getName();
            }
View Full Code Here


        assertNull(rs.getRef(1));
        assertTrue(rs.wasNull());
        assertNull(rs.getRef("column"));
        assertTrue(rs.wasNull());
        // Set what gets returned to something other than the default
        Ref ref = new SqlNullCheckedResultSetMockRef();
        rs2.setNullRef(ref);
        assertNotNull(rs.getRef(1));
        assertEquals(ref, rs.getRef(1));
        assertNotNull(rs.getRef("column"));
        assertEquals(ref, rs.getRef("column"));
View Full Code Here

     * Tests the setNullRef implementation.
     */
    public void testSetNullRef() throws SQLException {
        assertNull(rs2.getNullRef());
        // Set what gets returned to something other than the default
        Ref ref = new SqlNullCheckedResultSetMockRef();
        rs2.setNullRef(ref);
        assertNotNull(rs.getRef(1));
        assertEquals(ref, rs.getRef(1));
        assertNotNull(rs.getRef("column"));
        assertEquals(ref, rs.getRef("column"));
View Full Code Here

   */
  public Ref getRef(int parameterIndex) throws SQLException {
    synchronized (checkClosed().getConnectionMutex()) {
      ResultSetInternalMethods rs = getOutputParameters(parameterIndex);
 
      Ref retValue = rs
          .getRef(mapOutputParameterIndexToRsIndex(parameterIndex));
 
      this.outputParamWasNull = rs.wasNull();
 
      return retValue;
View Full Code Here

  public Ref getRef(String parameterName) throws SQLException {
    synchronized (checkClosed().getConnectionMutex()) {
      ResultSetInternalMethods rs = getOutputParameters(0); // definitely not going to be
      // from ?=
 
      Ref retValue = rs.getRef(fixParameterName(parameterName));
 
      this.outputParamWasNull = rs.wasNull();
 
      return retValue;
    }
View Full Code Here

   * @see java.sql.CallableStatement#getRef(int)
   */
  public synchronized Ref getRef(int parameterIndex) throws SQLException {
    ResultSet rs = getOutputParameters(parameterIndex);

    Ref retValue = rs
        .getRef(mapOutputParameterIndexToRsIndex(parameterIndex));

    this.outputParamWasNull = rs.wasNull();

    return retValue;
View Full Code Here

   */
  public synchronized Ref getRef(String parameterName) throws SQLException {
    ResultSet rs = getOutputParameters(0); // definitely not going to be
    // from ?=

    Ref retValue = rs.getRef(fixParameterName(parameterName));

    this.outputParamWasNull = rs.wasNull();

    return retValue;
  }
View Full Code Here

    }

    public void testSetRef() throws SQLException {
        BaseRowSetImpl brs = new BaseRowSetImpl();
        brs.initParams();
        Ref r = new MockRef();
        brs.setRef(1, r);
        Object[] params = brs.getParams();
        assertNotNull(params);
        assertEquals(1, params.length);
        assertTrue(r != params[0]);
View Full Code Here

    /**
     * @tests {@link javax.sql.rowset.serial.SQLOutputImpl#writeRef(Ref)}
     */
    public void test_writeRefLjava_sql_Ref() throws SQLException {
        Ref ref = new MockRef();
        impl.writeRef(ref);
        assertEquals(1, attr.size());
        assertTrue(attr.get(0) instanceof SerialRef);
    }
View Full Code Here

                    agent_.logWriter_.traceEntry(this, "getRef", parameterIndex);
                }
                super.checkForClosedStatement();
                checkGetterPreconditions(parameterIndex);
                setWasNull(parameterIndex);
                Ref result = wasNullX() ? null :
                    singletonRowData_.getRef(parameterIndex);

                if (true) {
                    throw new SqlException(agent_.logWriter_,
                        new ClientMessageId(SQLState.JDBC_METHOD_NOT_IMPLEMENTED));
View Full Code Here

TOP

Related Classes of java.sql.Ref

Copyright © 2018 www.massapicom. 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.