|
Posted on 2013-01-06 11:09 疯狂 阅读(5220) 评论(0) 编辑 收藏 所属分类: database 、 spring 、 读代码
spring在执行sql语句时,会根据用户提供的类型参数来进行sql参数的绑定,例如:
public int update(String sql, Object[] args, int[] argTypes) throws DataAccessException {
return update(sql, newArgTypePreparedStatementSetter(args, argTypes));
}
其中可用的type类型如下:
public class Types {
public final static int BIT = -7;
public final static int TINYINT = -6;
public final static int SMALLINT = 5;
public final static int INTEGER = 4;
public final static int BIGINT = -5;
public final static int FLOAT = 6;
public final static int REAL = 7;
public final static int DOUBLE = 8;
public final static int NUMERIC = 2;
public final static int DECIMAL = 3;
public final static int CHAR = 1;
public final static int VARCHAR = 12;
public final static int LONGVARCHAR = -1;
public final static int DATE = 91;
public final static int TIME = 92;
public final static int TIMESTAMP = 93;
public final static int BINARY = -2;
public final static int VARBINARY = -3;
public final static int LONGVARBINARY = -4;
public final static int NULL = 0;
public final static int OTHER = 1111;
public final static int JAVA_OBJECT = 2000;
public final static int DISTINCT = 2001;
public final static int STRUCT = 2002;
public final static int ARRAY = 2003;
public final static int BLOB = 2004;
public final static int CLOB = 2005;
public final static int REF = 2006;
public final static int DATALINK = 70;
public final static int BOOLEAN = 16;
// ------------------------- JDBC 4.0 -----------------------------------
public final static int ROWID = -8;
public static final int NCHAR = -15;
public static final int NVARCHAR = -9;
public static final int LONGNVARCHAR = -16;
public static final int NCLOB = 2011;
public static final int SQLXML = 2009;
}
其中argTypes里面设定了args参数数组里面每个对象的sql类型。最终spring设置参数的方法如下:
private static void setValue(PreparedStatement ps, int paramIndex, int sqlType, String typeName,
Integer scale, Object inValue) throws SQLException {
if (inValue instanceof SqlTypeValue) {
((SqlTypeValue) inValue).setTypeValue(ps, paramIndex, sqlType, typeName);
}
else if (inValue instanceof SqlValue) {
((SqlValue) inValue).setValue(ps, paramIndex);
}
else if (sqlType == Types.VARCHAR || sqlType == Types.LONGVARCHAR ||
(sqlType == Types.CLOB && isStringValue(inValue.getClass()))) {
ps.setString(paramIndex, inValue.toString());
}
else if (sqlType == Types.DECIMAL || sqlType == Types.NUMERIC) {
if (inValue instanceof BigDecimal) {
ps.setBigDecimal(paramIndex, (BigDecimal) inValue);
}
else if (scale != null) {
ps.setObject(paramIndex, inValue, sqlType, scale);
}
else {
ps.setObject(paramIndex, inValue, sqlType);
}
}
else if (sqlType == Types.DATE) {
if (inValue instanceof java.util.Date) {
if (inValue instanceof java.sql.Date) {
ps.setDate(paramIndex, (java.sql.Date) inValue);
}
else {
ps.setDate(paramIndex, new java.sql.Date(((java.util.Date) inValue).getTime()));
}
}
else if (inValue instanceof Calendar) {
Calendar cal = (Calendar) inValue;
ps.setDate(paramIndex, new java.sql.Date(cal.getTime().getTime()), cal);
}
else {
ps.setObject(paramIndex, inValue, Types.DATE);
}
}
else if (sqlType == Types.TIME) {
if (inValue instanceof java.util.Date) {
if (inValue instanceof java.sql.Time) {
ps.setTime(paramIndex, (java.sql.Time) inValue);
}
else {
ps.setTime(paramIndex, new java.sql.Time(((java.util.Date) inValue).getTime()));
}
}
else if (inValue instanceof Calendar) {
Calendar cal = (Calendar) inValue;
ps.setTime(paramIndex, new java.sql.Time(cal.getTime().getTime()), cal);
}
else {
ps.setObject(paramIndex, inValue, Types.TIME);
}
}
else if (sqlType == Types.TIMESTAMP) {
if (inValue instanceof java.util.Date) {
if (inValue instanceof java.sql.Timestamp) {
ps.setTimestamp(paramIndex, (java.sql.Timestamp) inValue);
}
else {
ps.setTimestamp(paramIndex, new java.sql.Timestamp(((java.util.Date) inValue).getTime()));
}
}
else if (inValue instanceof Calendar) {
Calendar cal = (Calendar) inValue;
ps.setTimestamp(paramIndex, new java.sql.Timestamp(cal.getTime().getTime()), cal);
}
else {
ps.setObject(paramIndex, inValue, Types.TIMESTAMP);
}
}
else if (sqlType == SqlTypeValue.TYPE_UNKNOWN) {
if (isStringValue(inValue.getClass())) {
ps.setString(paramIndex, inValue.toString());
}
else if (isDateValue(inValue.getClass())) {
ps.setTimestamp(paramIndex, new java.sql.Timestamp(((java.util.Date) inValue).getTime()));
}
else if (inValue instanceof Calendar) {
Calendar cal = (Calendar) inValue;
ps.setTimestamp(paramIndex, new java.sql.Timestamp(cal.getTime().getTime()), cal);
}
else {
// Fall back to generic setObject call without SQL type specified.
ps.setObject(paramIndex, inValue);}
}
else {
// Fall back to generic setObject call with SQL type specified.
ps.setObject(paramIndex, inValue, sqlType);
}
当我们没有给spring的相应方法传递参数类型的时候,例如调用:
public int update(String sql, Object args) throws DataAccessException {
return update(sql, newArgPreparedStatementSetter(args)); }
最终表现为SqlTypeValue.TYPE_UNKNOWN,对于非String,Date,Calendar 类型的对象对,spring将通过ps.setObject(paramIndex, inValue)进行参数设置,也就是交给我们的jdbc驱动(eg:jdbc6.jar)来进行设置,驱动程序会根据传递的对象来进行类型的转换并进行参数设置:
其中java类型到sql类型的转换如下:
oracle.jdbc.driver.OraclePreparedStatement
int sqlTypeForObject(Object paramObject)
{
if (paramObject == null)
{
return 0;
}
if (!(paramObject instanceof Datum))
{
if ((paramObject instanceof String))
{
return this.fixedString ? 999 : 12;
}
if ((paramObject instanceof BigDecimal)) {
return 2;
}
if ((paramObject instanceof Boolean)) {
return -7;
}
if ((paramObject instanceof Integer)) {
return 4;
}
if ((paramObject instanceof Long)) {
return -5;
}
if ((paramObject instanceof Float)) {
return 7;
}
if ((paramObject instanceof Double)) {
return 8;
}
if ((paramObject instanceof byte[])) {
return -3;
}
if ((paramObject instanceof Short)) {
return 5;
}
if ((paramObject instanceof Byte)) {
return -6;
}
if ((paramObject instanceof Date)) {
return 91;
}
if ((paramObject instanceof Time)) {
return 92;
}
if ((paramObject instanceof Timestamp)) {
return 93;
}
if ((paramObject instanceof SQLData)) {
return 2002;
}
if ((paramObject instanceof ObjectData))
return 2002;
}
其中驱动里面oracle的类型定义如下,和jdk里面Types类定义的基本对应。
public abstract class OracleTypes
{
public static final int BIT = -7;
public static final int TINYINT = -6;
public static final int SMALLINT = 5;
public static final int INTEGER = 4;
public static final int BIGINT = -5;
public static final int FLOAT = 6;
public static final int REAL = 7;
public static final int DOUBLE = 8;
public static final int NUMERIC = 2;
public static final int DECIMAL = 3;
public static final int CHAR = 1;
public static final int VARCHAR = 12;
public static final int LONGVARCHAR = -1;
public static final int DATE = 91;
public static final int TIME = 92;
public static final int TIMESTAMP = 93;
/** *//** @deprecated */
public static final int TIMESTAMPNS = -100;
public static final int TIMESTAMPTZ = -101;
public static final int TIMESTAMPLTZ = -102;
public static final int INTERVALYM = -103;
public static final int INTERVALDS = -104;
public static final int BINARY = -2;
public static final int VARBINARY = -3;
public static final int LONGVARBINARY = -4;
public static final int ROWID = -8;
public static final int CURSOR = -10;
public static final int BLOB = 2004;
public static final int CLOB = 2005;
public static final int BFILE = -13;
public static final int STRUCT = 2002;
public static final int ARRAY = 2003;
public static final int REF = 2006;
public static final int NCHAR = -15;
public static final int NCLOB = 2011;
public static final int NVARCHAR = -9;
public static final int LONGNVARCHAR = -16;
public static final int SQLXML = 2009;
public static final int OPAQUE = 2007;
public static final int JAVA_STRUCT = 2008;
public static final int JAVA_OBJECT = 2000;
public static final int PLSQL_INDEX_TABLE = -14;
public static final int BINARY_FLOAT = 100;
public static final int BINARY_DOUBLE = 101;
public static final int NULL = 0;
public static final int NUMBER = 2;
public static final int RAW = -2;
public static final int OTHER = 1111;
public static final int FIXED_CHAR = 999;
public static final int DATALINK = 70;
public static final int BOOLEAN = 16;
private static final String _Copyright_2007_Oracle_All_Rights_Reserved_ = null;
public static final String BUILD_DATE = "Fri_Jul_31_19:30:28_PDT_2009";
public static final boolean TRACE = false;
public static final boolean PRIVATE_TRACE = false;
}
最终驱动程序将根据转换的类型进行参数绑定,具体如下:
void setObjectCritical(int paramInt1, Object paramObject, int paramInt2, int paramInt3)
throws SQLException
{
SQLException localSQLException;
switch (paramInt2)
{
case 1:
if ((paramObject instanceof CHAR)) {
setCHARInternal(paramInt1, (CHAR)paramObject);
} else if ((paramObject instanceof String)) {
setStringInternal(paramInt1, (String)paramObject);
} else if ((paramObject instanceof Boolean)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Boolean)paramObject).booleanValue() ? 1 : 0).toString());
}
else if ((paramObject instanceof Integer)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Integer)paramObject).intValue()).toString());
} else if ((paramObject instanceof Long)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Long)paramObject).longValue()).toString());
} else if ((paramObject instanceof Float)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Float)paramObject).floatValue()).toString());
} else if ((paramObject instanceof Double)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Double)paramObject).doubleValue()).toString());
} else if ((paramObject instanceof BigDecimal)) {
setStringInternal(paramInt1, ((BigDecimal)paramObject).toString());
} else if ((paramObject instanceof Date)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Date)paramObject).toString()).toString());
} else if ((paramObject instanceof Time)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Time)paramObject).toString()).toString());
} else if ((paramObject instanceof Timestamp)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Timestamp)paramObject).toString()).toString());
}
else {
localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 132);
localSQLException.fillInStackTrace();
throw localSQLException;
}
case 12:
if ((paramObject instanceof String)) {
setStringInternal(paramInt1, (String)paramObject);
} else if ((paramObject instanceof Boolean)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Boolean)paramObject).booleanValue() ? 1 : 0).toString());
}
else if ((paramObject instanceof Integer)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Integer)paramObject).intValue()).toString());
} else if ((paramObject instanceof Long)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Long)paramObject).longValue()).toString());
} else if ((paramObject instanceof Float)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Float)paramObject).floatValue()).toString());
} else if ((paramObject instanceof Double)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Double)paramObject).doubleValue()).toString());
} else if ((paramObject instanceof BigDecimal)) {
setStringInternal(paramInt1, ((BigDecimal)paramObject).toString());
} else if ((paramObject instanceof Date)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Date)paramObject).toString()).toString());
} else if ((paramObject instanceof Time)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Time)paramObject).toString()).toString());
} else if ((paramObject instanceof Timestamp)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Timestamp)paramObject).toString()).toString());
}
else {
localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 132);
localSQLException.fillInStackTrace();
throw localSQLException;
}
case 999:
setFixedCHARInternal(paramInt1, (String)paramObject);
break;
case -1:
if ((paramObject instanceof String)) {
setStringInternal(paramInt1, (String)paramObject);
} else if ((paramObject instanceof Boolean)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Boolean)paramObject).booleanValue() ? 1 : 0).toString());
}
else if ((paramObject instanceof Integer)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Integer)paramObject).intValue()).toString());
}
else if ((paramObject instanceof Long)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Long)paramObject).longValue()).toString());
}
else if ((paramObject instanceof Float)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Float)paramObject).floatValue()).toString());
}
else if ((paramObject instanceof Double)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Double)paramObject).doubleValue()).toString());
}
else if ((paramObject instanceof BigDecimal)) {
setStringInternal(paramInt1, ((BigDecimal)paramObject).toString());
} else if ((paramObject instanceof Date)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Date)paramObject).toString()).toString());
} else if ((paramObject instanceof Time)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Time)paramObject).toString()).toString());
} else if ((paramObject instanceof Timestamp)) {
setStringInternal(paramInt1, new StringBuilder().append("").append(((Timestamp)paramObject).toString()).toString());
}
else
{
localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 132);
localSQLException.fillInStackTrace();
throw localSQLException;
}
case 2:
if ((paramObject instanceof NUMBER)) {
setNUMBERInternal(paramInt1, (NUMBER)paramObject);
} else if ((paramObject instanceof Integer)) {
setIntInternal(paramInt1, ((Integer)paramObject).intValue());
} else if ((paramObject instanceof Long)) {
setLongInternal(paramInt1, ((Long)paramObject).longValue());
} else if ((paramObject instanceof Float)) {
setFloatInternal(paramInt1, ((Float)paramObject).floatValue());
} else if ((paramObject instanceof Double)) {
setDoubleInternal(paramInt1, ((Double)paramObject).doubleValue());
} else if ((paramObject instanceof BigDecimal)) {
setBigDecimalInternal(paramInt1, (BigDecimal)paramObject);
} else if ((paramObject instanceof String)) {
setNUMBERInternal(paramInt1, new NUMBER((String)paramObject, paramInt3));
} else if ((paramObject instanceof Boolean)) {
setIntInternal(paramInt1, ((Boolean)paramObject).booleanValue() ? 1 : 0);
}
else {
localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 132);
localSQLException.fillInStackTrace();
throw localSQLException;
}
case 3:
if ((paramObject instanceof BigDecimal)) {
setBigDecimalInternal(paramInt1, (BigDecimal)paramObject);
} else if ((paramObject instanceof Number)) {
setBigDecimalInternal(paramInt1, new BigDecimal(((Number)paramObject).doubleValue()));
}
else if ((paramObject instanceof NUMBER)) {
setBigDecimalInternal(paramInt1, ((NUMBER)paramObject).bigDecimalValue());
} else if ((paramObject instanceof String)) {
setBigDecimalInternal(paramInt1, new BigDecimal((String)paramObject));
} else if ((paramObject instanceof Boolean)) {
setBigDecimalInternal(paramInt1, new BigDecimal(((Boolean)paramObject).booleanValue() ? 1.0D : 0.0D));
}
else
{
localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 132);
localSQLException.fillInStackTrace();
throw localSQLException;
}
case -7:
if ((paramObject instanceof Boolean)) {
setByteInternal(paramInt1, (byte)(((Boolean)paramObject).booleanValue() ? 1 : 0));
}
else if ((paramObject instanceof String)) {
setByteInternal(paramInt1, (byte)(("true".equalsIgnoreCase((String)paramObject)) || ("1".equals(paramObject)) ? 1 : 0));
}
else if ((paramObject instanceof Number)) {
setIntInternal(paramInt1, ((Number)paramObject).byteValue() != 0 ? 1 : 0);
}
else {
localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 132);
localSQLException.fillInStackTrace();
throw localSQLException;
}
case -6:
if ((paramObject instanceof Number)) {
setByteInternal(paramInt1, ((Number)paramObject).byteValue());
} else if ((paramObject instanceof String)) {
setByteInternal(paramInt1, Byte.parseByte((String)paramObject));
} else if ((paramObject instanceof Boolean)) {
setByteInternal(paramInt1, (byte)(((Boolean)paramObject).booleanValue() ? 1 : 0));
}
else
{
localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 132);
localSQLException.fillInStackTrace();
throw localSQLException;
}
case 5:
if ((paramObject instanceof Number)) {
setShortInternal(paramInt1, ((Number)paramObject).shortValue());
} else if ((paramObject instanceof String)) {
setShortInternal(paramInt1, Short.parseShort((String)paramObject));
} else if ((paramObject instanceof Boolean)) {
setShortInternal(paramInt1, (short)(((Boolean)paramObject).booleanValue() ? 1 : 0));
}
else
{
localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 132);
localSQLException.fillInStackTrace();
throw localSQLException;
}
case 4:
if ((paramObject instanceof Number)) {
setIntInternal(paramInt1, ((Number)paramObject).intValue());
} else if ((paramObject instanceof String)) {
setIntInternal(paramInt1, Integer.parseInt((String)paramObject));
} else if ((paramObject instanceof Boolean)) {
setIntInternal(paramInt1, ((Boolean)paramObject).booleanValue() ? 1 : 0);
}
else {
localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 132);
localSQLException.fillInStackTrace();
throw localSQLException;
}
case -5:
if ((paramObject instanceof Number)) {
setLongInternal(paramInt1, ((Number)paramObject).longValue());
} else if ((paramObject instanceof String)) {
setLongInternal(paramInt1, Long.parseLong((String)paramObject));
} else if ((paramObject instanceof Boolean)) {
setLongInternal(paramInt1, ((Boolean)paramObject).booleanValue() ? 1L : 0L);
}
else {
localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 132);
localSQLException.fillInStackTrace();
throw localSQLException;
}
case 7:
if ((paramObject instanceof Number)) {
setFloatInternal(paramInt1, ((Number)paramObject).floatValue());
} else if ((paramObject instanceof String)) {
setFloatInternal(paramInt1, Float.valueOf((String)paramObject).floatValue());
} else if ((paramObject instanceof Boolean)) {
setFloatInternal(paramInt1, ((Boolean)paramObject).booleanValue() ? 1.0F : 0.0F);
}
else {
localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 132);
localSQLException.fillInStackTrace();
throw localSQLException;
}
case 6:
case 8:
if ((paramObject instanceof Number)) {
setDoubleInternal(paramInt1, ((Number)paramObject).doubleValue());
} else if ((paramObject instanceof String)) {
setDoubleInternal(paramInt1, Double.valueOf((String)paramObject).doubleValue());
}
else if ((paramObject instanceof Boolean)) {
setDoubleInternal(paramInt1, ((Boolean)paramObject).booleanValue() ? 1.0D : 0.0D);
}
else
{
localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 132);
localSQLException.fillInStackTrace();
throw localSQLException;
}
case -2:
if ((paramObject instanceof RAW))
setRAWInternal(paramInt1, (RAW)paramObject);
else {
setBytesInternal(paramInt1, (byte[])(byte[])paramObject);
}
break;
case -3:
setBytesInternal(paramInt1, (byte[])(byte[])paramObject);
break;
case -4:
setBytesInternal(paramInt1, (byte[])(byte[])paramObject);
break;
case 91:
if ((paramObject instanceof DATE)) {
setDATEInternal(paramInt1, (DATE)paramObject);
} else if ((paramObject instanceof Date)) {
setDateInternal(paramInt1, (Date)paramObject);
} else if ((paramObject instanceof Timestamp)) {
setDATEInternal(paramInt1, new DATE((Timestamp)paramObject));
} else if ((paramObject instanceof String)) {
setDateInternal(paramInt1, Date.valueOf((String)paramObject));
}
else {
localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 132);
localSQLException.fillInStackTrace();
throw localSQLException;
}
case 92:
if ((paramObject instanceof Time)) {
setTimeInternal(paramInt1, (Time)paramObject);
} else if ((paramObject instanceof Timestamp)) {
setTimeInternal(paramInt1, new Time(((Timestamp)paramObject).getTime()));
}
else if ((paramObject instanceof Date)) {
setTimeInternal(paramInt1, new Time(((Date)paramObject).getTime()));
} else if ((paramObject instanceof String)) {
setTimeInternal(paramInt1, Time.valueOf((String)paramObject));
}
else {
localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 132);
localSQLException.fillInStackTrace();
throw localSQLException;
}
case 93:
if ((paramObject instanceof TIMESTAMP)) {
setTIMESTAMPInternal(paramInt1, (TIMESTAMP)paramObject);
} else if ((paramObject instanceof Timestamp)) {
setTimestampInternal(paramInt1, (Timestamp)paramObject);
} else if ((paramObject instanceof Date)) {
setTIMESTAMPInternal(paramInt1, new TIMESTAMP((Date)paramObject));
} else if ((paramObject instanceof DATE)) {
setTIMESTAMPInternal(paramInt1, new TIMESTAMP(((DATE)paramObject).timestampValue()));
} else if ((paramObject instanceof String)) {
setTimestampInternal(paramInt1, Timestamp.valueOf((String)paramObject));
}
else {
localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 132);
localSQLException.fillInStackTrace();
throw localSQLException;
}
case -100:
setTIMESTAMPInternal(paramInt1, (TIMESTAMP)paramObject);
break;
case -101:
setTIMESTAMPTZInternal(paramInt1, (TIMESTAMPTZ)paramObject);
break;
case -102:
setTIMESTAMPLTZInternal(paramInt1, (TIMESTAMPLTZ)paramObject);
break;
case -103:
setINTERVALYMInternal(paramInt1, (INTERVALYM)paramObject);
break;
case -104:
setINTERVALDSInternal(paramInt1, (INTERVALDS)paramObject);
break;
case -8:
setROWIDInternal(paramInt1, (ROWID)paramObject);
break;
case 100:
setBinaryFloatInternal(paramInt1, (BINARY_FLOAT)paramObject);
break;
case 101:
setBinaryDoubleInternal(paramInt1, (BINARY_DOUBLE)paramObject);
break;
case 2004:
setBLOBInternal(paramInt1, (BLOB)paramObject);
break;
case 2005:
setCLOBInternal(paramInt1, (CLOB)paramObject);
break;
case -13:
setBFILEInternal(paramInt1, (BFILE)paramObject);
break;
case 2002:
case 2008:
setSTRUCTInternal(paramInt1, STRUCT.toSTRUCT(paramObject, this.connection));
break;
case 2003:
setARRAYInternal(paramInt1, ARRAY.toARRAY(paramObject, this.connection));
break;
case 2007:
setOPAQUEInternal(paramInt1, (OPAQUE)paramObject);
break;
case 2006:
setREFInternal(paramInt1, (REF)paramObject);
break;
default:
localSQLException = DatabaseError.createSqlException(getConnectionDuringExceptionHandling(), 4);
localSQLException.fillInStackTrace();
throw localSQLException;
}
}
~完~
文章比较粗糙,仅供参考。
|