當前位置: 首頁>>代碼示例>>Java>>正文


Java Ref類代碼示例

本文整理匯總了Java中java.sql.Ref的典型用法代碼示例。如果您正苦於以下問題:Java Ref類的具體用法?Java Ref怎麽用?Java Ref使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Ref類屬於java.sql包,在下文中一共展示了Ref類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: buildJdbcJavaClassMappings

import java.sql.Ref; //導入依賴的package包/類
private static ConcurrentHashMap<Class, Integer> buildJdbcJavaClassMappings() {
	ConcurrentHashMap<Class, Integer> jdbcJavaClassMappings = new ConcurrentHashMap<Class, Integer>();

	// these mappings are the ones outlined specifically in the spec
	jdbcJavaClassMappings.put( String.class, Types.VARCHAR );
	jdbcJavaClassMappings.put( BigDecimal.class, Types.NUMERIC );
	jdbcJavaClassMappings.put( Boolean.class, Types.BIT );
	jdbcJavaClassMappings.put( Integer.class, Types.INTEGER );
	jdbcJavaClassMappings.put( Long.class, Types.BIGINT );
	jdbcJavaClassMappings.put( Float.class, Types.REAL );
	jdbcJavaClassMappings.put( Double.class, Types.DOUBLE );
	jdbcJavaClassMappings.put( byte[].class, Types.LONGVARBINARY );
	jdbcJavaClassMappings.put( java.sql.Date.class, Types.DATE );
	jdbcJavaClassMappings.put( Time.class, Types.TIME );
	jdbcJavaClassMappings.put( Timestamp.class, Types.TIMESTAMP );
	jdbcJavaClassMappings.put( Blob.class, Types.BLOB );
	jdbcJavaClassMappings.put( Clob.class, Types.CLOB );
	jdbcJavaClassMappings.put( Array.class, Types.ARRAY );
	jdbcJavaClassMappings.put( Struct.class, Types.STRUCT );
	jdbcJavaClassMappings.put( Ref.class, Types.REF );
	jdbcJavaClassMappings.put( Class.class, Types.JAVA_OBJECT );

	// additional "common sense" registrations
	jdbcJavaClassMappings.put( Character.class, Types.CHAR );
	jdbcJavaClassMappings.put( char[].class, Types.VARCHAR );
	jdbcJavaClassMappings.put( Character[].class, Types.VARCHAR );
	jdbcJavaClassMappings.put( Byte[].class, Types.LONGVARBINARY );
	jdbcJavaClassMappings.put( java.util.Date.class, Types.TIMESTAMP );
	jdbcJavaClassMappings.put( Calendar.class, Types.TIMESTAMP );

	return jdbcJavaClassMappings;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:33,代碼來源:JdbcTypeJavaClassMappings.java

示例2: test09

import java.sql.Ref; //導入依賴的package包/類
@Test(enabled = true)
public void test09() throws Exception {
    Ref ref = new StubRef(sqlType, hero);
    Object[] values = {ref};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Ref ref2 = sqli.readRef();
    assertTrue(ref.getObject().equals(ref2.getObject()));
    assertTrue(ref.getBaseTypeName().equals(ref2.getBaseTypeName()));
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:10,代碼來源:SQLInputImplTests.java

示例3: setRef

import java.sql.Ref; //導入依賴的package包/類
public void setRef(int parameterIndex, Ref x) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            ((PreparedStatement) this.wrappedStmt).setRef(parameterIndex, x);
        } else {
            throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);
        }
    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }
}
 
開發者ID:JuanJoseFJ,項目名稱:ProyectoPacientes,代碼行數:12,代碼來源:PreparedStatementWrapper.java

示例4: getRef

import java.sql.Ref; //導入依賴的package包/類
/**
 * @see java.sql.CallableStatement#getRef(java.lang.String)
 */
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;
    }
}
 
開發者ID:bragex,項目名稱:the-vigilantes,代碼行數:15,代碼來源:CallableStatement.java

示例5: createDataTypesRows

import java.sql.Ref; //導入依賴的package包/類
protected void createDataTypesRows(RowSet crs) throws SQLException {

        Integer aInteger = 100;
        String aChar = "Oswald Cobblepot";
        Long aLong = Long.MAX_VALUE;
        Short aShort = Short.MAX_VALUE;
        Double aDouble = Double.MAX_VALUE;
        BigDecimal aBigDecimal = BigDecimal.ONE;
        Boolean aBoolean = false;
        Float aFloat = Float.MAX_VALUE;
        Byte aByte = Byte.MAX_VALUE;
        Date aDate = Date.valueOf(LocalDate.now());
        Time aTime = Time.valueOf(LocalTime.now());
        Timestamp aTimeStamp = Timestamp.valueOf(LocalDateTime.now());
        Array aArray = new StubArray("INTEGER", new Object[1]);
        Ref aRef = new SerialRef(new StubRef("INTEGER", query));
        byte[] bytes = new byte[10];
        crs.moveToInsertRow();
        crs.updateInt(1, aInteger);
        crs.updateString(2, aChar);
        crs.updateString(3, aChar);
        crs.updateLong(4, aLong);
        crs.updateBoolean(5, aBoolean);
        crs.updateShort(6, aShort);
        crs.updateDouble(7, aDouble);
        crs.updateBigDecimal(8, aBigDecimal);
        crs.updateFloat(9, aFloat);
        crs.updateByte(10, aByte);
        crs.updateDate(11, aDate);
        crs.updateTime(12, aTime);
        crs.updateTimestamp(13, aTimeStamp);
        crs.updateBytes(14, bytes);
        crs.updateArray(15, aArray);
        crs.updateRef(16, aRef);
        crs.updateDouble(17, aDouble);
        crs.insertRow();
        crs.moveToCurrentRow();

    }
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:40,代碼來源:CommonCachedRowSetTests.java

示例6: getRef

import java.sql.Ref; //導入依賴的package包/類
public Ref getRef(String parameterName) throws SQLException {
    try {
        if (this.wrappedStmt != null) {
            return ((CallableStatement) this.wrappedStmt).getRef(parameterName);
        }
        throw SQLError.createSQLException("No operations allowed after statement closed", SQLError.SQL_STATE_GENERAL_ERROR, this.exceptionInterceptor);

    } catch (SQLException sqlEx) {
        checkAndFireConnectionError(sqlEx);
    }

    return null;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:14,代碼來源:CallableStatementWrapper.java

示例7: getRef

import java.sql.Ref; //導入依賴的package包/類
@Override
public Ref getRef(int columnIndex) throws SQLException
{
	throw new SQLFeatureNotSupportedException();
}
 
開發者ID:olavloite,項目名稱:spanner-jdbc,代碼行數:6,代碼來源:AbstractCloudSpannerResultSet.java

示例8: getRef

import java.sql.Ref; //導入依賴的package包/類
@Override
public Ref getRef( int columnIndex ) throws SQLException {
  throwIfClosed();
  return super.getRef( columnIndex );
}
 
開發者ID:dremio,項目名稱:dremio-oss,代碼行數:6,代碼來源:DremioResultSetImpl.java

示例9: updateRef

import java.sql.Ref; //導入依賴的package包/類
@Override
public void updateRef(int columnIndex, Ref x) throws SQLException
{
	throw new SQLFeatureNotSupportedException();
}
 
開發者ID:olavloite,項目名稱:spanner-jdbc,代碼行數:6,代碼來源:AbstractCloudSpannerResultSet.java

示例10: setRef

import java.sql.Ref; //導入依賴的package包/類
@Override
public void setRef(int i, Ref x) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:5,代碼來源:StubWebRowSetImpl.java

示例11: setRef

import java.sql.Ref; //導入依賴的package包/類
@Override
public void setRef(int parameterIndex, Ref x) throws SQLException
{
	parameters.setParameter(parameterIndex, x);
}
 
開發者ID:olavloite,項目名稱:spanner-jdbc,代碼行數:6,代碼來源:AbstractCloudSpannerPreparedStatement.java

示例12: getRef

import java.sql.Ref; //導入依賴的package包/類
@Override
public Ref getRef(String columnLabel) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:5,代碼來源:ResultSetAdapter.java

示例13: getRef

import java.sql.Ref; //導入依賴的package包/類
@Override
public Ref getRef(int parameterIndex) throws SQLException {
    return wrappedStatement.getRef( parameterIndex );
}
 
開發者ID:agroal,項目名稱:agroal,代碼行數:5,代碼來源:CallableStatementWrapper.java

示例14: getRef

import java.sql.Ref; //導入依賴的package包/類
@Override public Ref getRef(int columnIndex) throws SQLException {
    return null;
}
 
開發者ID:SkywalkingTest,項目名稱:Agent-Benchmarks,代碼行數:4,代碼來源:SimulateResultSet.java

示例15: updateRef

import java.sql.Ref; //導入依賴的package包/類
@Override
public void updateRef(int columnIndex, Ref x) throws SQLException {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:5,代碼來源:StubBaseRowSet.java


注:本文中的java.sql.Ref類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。