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


Java Types.ROWID屬性代碼示例

本文整理匯總了Java中java.sql.Types.ROWID屬性的典型用法代碼示例。如果您正苦於以下問題:Java Types.ROWID屬性的具體用法?Java Types.ROWID怎麽用?Java Types.ROWID使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.sql.Types的用法示例。


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

示例1: literalize

private String literalize(List<String> v, int type){
	StringJoiner sj = new StringJoiner(",", "(",")");
	if(type == Types.NUMERIC || type == Types.BIGINT || type == Types.BIT || type == Types.DECIMAL
			|| type == Types.DOUBLE || type == Types.FLOAT || type == Types.INTEGER || type == Types.REAL || type == Types.ROWID
			|| type == Types.SMALLINT || type == Types.TINYINT){


		v.forEach(s -> sj.add(s) );
	}else{
		v.forEach(s -> sj.add("'" + s + "'") );
	}
	return sj.toString();
}
 
開發者ID:ajoabraham,項目名稱:hue,代碼行數:13,代碼來源:JoinDetector.java

示例2: getSQLType

/**
 * Get the SQLType for the given java.sql.Type type.
 *
 * @param type the java.sql.Type type specifier
 * @return SQLType.the SQLType for this java.sql.Type, or null if it's not recognized
 */
public static SQLType getSQLType(int type) {
    switch (type) {
        case Types.BIT: return SQLType.BIT;
        case Types.TINYINT: return SQLType.TINYINT;
        case Types.SMALLINT: return SQLType.SMALLINT;
        case Types.INTEGER: return SQLType.INTEGER;
        case Types.BIGINT: return SQLType.BIGINT;
        case Types.FLOAT: return SQLType.FLOAT;
        case Types.REAL: return SQLType.REAL;
        case Types.DOUBLE: return SQLType.DOUBLE;
        case Types.NUMERIC: return SQLType.NUMERIC;
        case Types.DECIMAL: return SQLType.DECIMAL;
        case Types.CHAR: return SQLType.CHAR;
        case Types.VARCHAR: return SQLType.VARCHAR;
        case Types.LONGVARCHAR: return SQLType.LONGVARCHAR;
        case Types.DATE: return SQLType.DATE;
        case Types.TIME: return SQLType.TIME;
        case Types.TIMESTAMP: return SQLType.TIMESTAMP;
        case Types.BINARY: return SQLType.BINARY;
        case Types.VARBINARY: return SQLType.VARBINARY;
        case Types.LONGVARBINARY: return SQLType.LONGVARBINARY;
        case Types.NULL: return SQLType.NULL;
        case Types.OTHER: return SQLType.OTHER;
        case Types.JAVA_OBJECT: return SQLType.JAVA_OBJECT;
        case Types.DISTINCT: return SQLType.DISTINCT;
        case Types.STRUCT: return SQLType.STRUCT;
        case Types.ARRAY: return SQLType.ARRAY;
        case Types.BLOB: return SQLType.BLOB;
        case Types.CLOB: return SQLType.CLOB;
        case Types.REF: return SQLType.REF;
        case Types.DATALINK: return SQLType.DATALINK;
        case Types.BOOLEAN: return SQLType.BOOLEAN;
        case Types.LONGNVARCHAR: return SQLType.LONGVARCHAR;
        case Types.NCHAR: return SQLType.CHAR;
        case Types.NCLOB: return SQLType.CLOB;
        case Types.NVARCHAR: return SQLType.VARCHAR;
        case Types.SQLXML: return SQLType.SQLXML;
        case Types.ROWID: return SQLType.ROWID;
        default:
            Logger.getLogger(JDBCUtils.class.getName()).log(Level.WARNING, "Unknown JDBC column type: " + type + ". Returns null.");
            return null;
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:49,代碼來源:JDBCUtils.java

示例3: getTypeClass

protected static Class<? extends Object> getTypeClass(DBColumn col) {
    int colType = col.getJdbcType();

    if (colType == Types.BIT && col.getPrecision() <= 1) {
        colType = Types.BOOLEAN;
    }

    switch (colType) {
        case Types.BOOLEAN:
            return Boolean.class;
        case Types.TIME:
            return Time.class;
        case Types.DATE:
            return Date.class;
        case Types.TIMESTAMP:
        case DBReadWriteHelper.SQL_TYPE_ORACLE_TIMESTAMP:
        case DBReadWriteHelper.SQL_TYPE_ORACLE_TIMESTAMP_WITH_TZ:
            return Timestamp.class;
        case Types.BIGINT:
            return BigInteger.class;
        case Types.DOUBLE:
            return Double.class;
        case Types.FLOAT:
        case Types.REAL:
            return Float.class;
        case Types.DECIMAL:
        case Types.NUMERIC:
            return BigDecimal.class;
        case Types.INTEGER:
        case Types.SMALLINT:
        case Types.TINYINT:
            return Long.class;

        case Types.CHAR:
        case Types.VARCHAR:
        case Types.NCHAR:
        case Types.NVARCHAR:
        case Types.ROWID:
            return String.class;

        case Types.BIT:
        case Types.BINARY:
        case Types.VARBINARY:
        case Types.LONGVARBINARY:
        case Types.BLOB:
            return Blob.class;
        case Types.LONGVARCHAR:
        case Types.LONGNVARCHAR:
        case Types.CLOB:
        case Types.NCLOB: /*NCLOB */
            return Clob.class;
        case Types.OTHER:
        default:
            return Object.class;
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:56,代碼來源:ResultSetTableModel.java

示例4: getParameterJavaValue

static public Object getParameterJavaValue(int param_type, String value) throws UnsupportedEncodingException, MalformedURLException, SQLException {
	if (value != null) {
		switch (param_type) {
	    	case Types.ARRAY: 
	    		return value.split(",");
	        case Types.BIGINT: 
	        	return Long.valueOf(value);
	        case Types.BINARY: 
	        	return String.valueOf(value).getBytes("UTF-8");
	        case Types.BIT: 
	        	return Boolean.valueOf(value);
	        case Types.BLOB:
	        	return value;//connection.createBlob();//
	        case Types.BOOLEAN:
	        	return Boolean.valueOf(value);
	        case Types.CHAR: 
	        	return String.valueOf(value);
	        case Types.CLOB: 
	        	return value;//connection.createClob();//
	        case Types.DATALINK: 
	        	return new java.net.URL(value);
	        case Types.DATE: 
	        	return java.sql.Date.valueOf(value); 
	        case Types.DECIMAL: 
	        	return java.math.BigDecimal.valueOf(Double.valueOf(value)); 
	        case Types.DISTINCT: 
	        	return value;//Object.class; 
	        case Types.DOUBLE: 
	        	return Double.valueOf(value); 
	        case Types.FLOAT: 
	        	return Double.valueOf(value); 
	        case Types.INTEGER: 
	        	return Integer.valueOf(value, 10); 
	        case Types.JAVA_OBJECT: 
	        	return value;//Object.class; 
	        case Types.LONGVARBINARY: 
	        	return String.valueOf(value).getBytes("UTF-8"); 
	        case Types.LONGVARCHAR: 
	        	return String.valueOf(value);
	        case Types.NCLOB: 
	        	return value;//connection.createNClob();//
	        case Types.NULL: 
	        	return null;//Object.class; 
	        case Types.NUMERIC: 
	        	return java.math.BigDecimal.valueOf(Double.parseDouble(value));  
	        case Types.NCHAR: 
	        case Types.NVARCHAR: 
	        case Types.LONGNVARCHAR: 
	        	return String.valueOf(value);
	        case Types.OTHER: 
	        	return value;//Object.class; 
	        case Types.REAL: 
	        	return Float.parseFloat(value); 
	        case Types.REF: 
	        	return value;//java.sql.Ref.class;
	        case Types.ROWID: 
	        	return value;//java.sql.RowId.class; 
	        case Types.SMALLINT: 
	        	return Short.valueOf(value); 
	        case Types.STRUCT: 
	        	return value;//connection.createStruct(typeName, attributes);//
	        case Types.SQLXML: 
	        	return value;//connection.createSQLXML();//
	        case Types.TIME: 
	        	return java.sql.Time.valueOf(value); 
	        case Types.TIMESTAMP: 
	        	return java.sql.Timestamp.valueOf(value); 
	        case Types.TINYINT: 
	        	return Byte.valueOf(value); 
	        case Types.VARBINARY: 
	        	return String.valueOf(value).getBytes("UTF-8");
	        case Types.VARCHAR: 
	        	return String.valueOf(value);
	        default: 
	        	return value;
        }
	}
	return null;
}
 
開發者ID:convertigo,項目名稱:convertigo-engine,代碼行數:79,代碼來源:SqlConnector.java

示例5: getParameterJavaClass

static public Class<?> getParameterJavaClass(int param_type) {
	switch (param_type) {
    	case Types.ARRAY: 
    		return Object[].class; 
        case Types.BIGINT: 
        	return Long.class; 
        case Types.BINARY: 
        	return byte[].class; 
        case Types.BIT: 
        	return Boolean.class; 
        case Types.BLOB: 
        	return java.sql.Blob.class; 
        case Types.BOOLEAN:
        	return Boolean.class; 
        case Types.CHAR: 
        	return String.class; 
        case Types.CLOB: 
        	return java.sql.Clob.class; 
        case Types.DATALINK: 
        	return java.net.URL.class; 
        case Types.DATE: 
        	return java.sql.Date.class; 
        case Types.DECIMAL: 
        	return java.math.BigDecimal.class; 
        case Types.DISTINCT: 
        	return Object.class; 
        case Types.DOUBLE: 
        	return Double.class; 
        case Types.FLOAT: 
        	return Double.class; 
        case Types.INTEGER: 
        	return Integer.class; 
        case Types.JAVA_OBJECT: 
        	return Object.class; 
        case Types.LONGVARBINARY: 
        	return byte[].class; 
        case Types.LONGVARCHAR: 
        	return String.class; 
        case Types.NCLOB: 
        	return java.sql.NClob.class; 
        case Types.NULL: 
        	return Object.class; 
        case Types.NUMERIC: 
        	return java.math.BigDecimal.class; 
        case Types.NCHAR: 
        case Types.NVARCHAR: 
        case Types.LONGNVARCHAR: 
        	return String.class; 
        case Types.OTHER: 
        	return Object.class; 
        case Types.REAL: 
        	return Float.class; 
        case Types.REF: 
        	return java.sql.Ref.class; 
        case Types.ROWID: 
        	return java.sql.RowId.class; 
        case Types.SMALLINT: 
        	return Short.class; 
        case Types.STRUCT: 
        	return java.sql.Struct.class; 
        case Types.SQLXML: 
        	return java.sql.SQLXML.class; 
        case Types.TIME: 
        	return java.sql.Time.class; 
        case Types.TIMESTAMP: 
        	return java.sql.Timestamp.class; 
        case Types.TINYINT: 
        	return Byte.class; 
        case Types.VARBINARY: 
        	return byte[].class; 
        case Types.VARCHAR: 
        	return String.class; 
        default: 
        	return Object.class;
       }
}
 
開發者ID:convertigo,項目名稱:convertigo-engine,代碼行數:76,代碼來源:SqlConnector.java

示例6: sqlTypeString

public static String sqlTypeString(int sqlType) {
  switch (sqlType) {
    case Types.BIT:
      return "BIT";
    case Types.TINYINT:
      return "TINYINT";
    case Types.SMALLINT:
      return "SMALLINT";
    case Types.INTEGER:
      return "INTEGER";
    case Types.BIGINT:
      return "BIGINT";
    case Types.FLOAT:
      return "FLOAT";
    case Types.REAL:
      return "REAL";
    case Types.DOUBLE:
      return "DOUBLE";
    case Types.NUMERIC:
      return "NUMERIC";
    case Types.DECIMAL:
      return "DECIMAL";
    case Types.CHAR:
      return "CHAR";
    case Types.VARCHAR:
      return "VARCHAR";
    case Types.LONGVARCHAR:
      return "LONGVARCHAR";
    case Types.DATE:
      return "DATE";
    case Types.TIME:
      return "TIME";
    case Types.TIMESTAMP:
      return "TIMESTAMP";
    case Types.BINARY:
      return "BINARY";
    case Types.VARBINARY:
      return "VARBINARY";
    case Types.LONGVARBINARY:
      return "LONGVARBINARY";
    case Types.NULL:
      return "NULL";
    case Types.OTHER:
      return "OTHER";
    case Types.JAVA_OBJECT:
      return "JAVA_OBJECT";
    case Types.DISTINCT:
      return "DISTINCT";
    case Types.STRUCT:
      return "STRUCT";
    case Types.ARRAY:
      return "ARRAY";
    case Types.BLOB:
      return "BLOB";
    case Types.CLOB:
      return "CLOB";
    case Types.REF:
      return "REF";
    case Types.DATALINK:
      return "DATALINK";
    case Types.BOOLEAN:
      return "BOOLEAN";
    case Types.ROWID:
      return "ROWID";
    case Types.NCHAR:
      return "NCHAR";
    case Types.NVARCHAR:
      return "NVARCHAR";
    case Types.LONGNVARCHAR:
      return "LONGNVARCHAR";
    case Types.NCLOB:
      return "NCLOB";
    case Types.SQLXML:
      return "SQLXML";
    default:
      return "<UNKNOWN>";
  }
}
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:78,代碼來源:SqoopHCatUtilities.java

示例7: getColumnType

public int getColumnType(int column) throws SQLException{
    int type = CIL.unbox_int( getColumnMeta(column, "ProviderType") );
    switch(type){
        case OdbcType.VarChar:
            return Types.VARCHAR;
        case OdbcType.Char:
            return Types.CHAR;
        case OdbcType.Binary:
        case OdbcType.Timestamp:
            return Types.BINARY;
        case OdbcType.Bit:
            return Types.BOOLEAN;
        case OdbcType.TinyInt:
            return Types.TINYINT;
        case OdbcType.Date:
            return Types.DATE;
        case OdbcType.DateTime:
        case OdbcType.SmallDateTime:
            return Types.TIMESTAMP;
        case OdbcType.Decimal:
            return Types.DECIMAL;
        case OdbcType.Double:
            return Types.DOUBLE;
        case OdbcType.UniqueIdentifier:
            return Types.ROWID;
        case OdbcType.SmallInt:
            return Types.SMALLINT;
        case OdbcType.Int:
            return Types.INTEGER;
        case OdbcType.BigInt:
            return Types.BIGINT;
        case OdbcType.Real:
            return Types.FLOAT;
        case OdbcType.NVarChar:
            return Types.NVARCHAR;
        case OdbcType.NChar:
            return Types.NCHAR;
        case OdbcType.NText:
            return Types.LONGNVARCHAR;
        case OdbcType.Text:
            return Types.LONGVARCHAR;
        case OdbcType.Image:
            return Types.LONGVARBINARY;
        case OdbcType.Time:
            return Types.TIME;
        case OdbcType.Numeric:
            return Types.NUMERIC;
        case OdbcType.VarBinary:
            return Types.VARBINARY;
    }
    return Types.OTHER;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:52,代碼來源:JdbcOdbcResultSetMetaData.java


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