当前位置: 首页>>代码示例>>Java>>正文


Java Types.LONGVARBINARY属性代码示例

本文整理汇总了Java中java.sql.Types.LONGVARBINARY属性的典型用法代码示例。如果您正苦于以下问题:Java Types.LONGVARBINARY属性的具体用法?Java Types.LONGVARBINARY怎么用?Java Types.LONGVARBINARY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.sql.Types的用法示例。


在下文中一共展示了Types.LONGVARBINARY属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: useBufferRowExplicit

public static boolean useBufferRowExplicit(Field[] fields) {
    if (fields == null) {
        return false;
    }

    for (int i = 0; i < fields.length; i++) {
        switch (fields[i].getSQLType()) {
            case Types.BLOB:
            case Types.CLOB:
            case Types.LONGVARBINARY:
            case Types.LONGVARCHAR:
                return true;
        }
    }

    return false;
}
 
开发者ID:Jugendhackt,项目名称:OpenVertretung,代码行数:17,代码来源:MysqlIO.java

示例2: isPrecisionRequired

public static boolean isPrecisionRequired(int jdbcType) {
    switch (jdbcType) {
        case Types.BIGINT:
        case Types.BOOLEAN:
        case Types.INTEGER:
        case Types.SMALLINT:
        case Types.TINYINT:
        case Types.FLOAT:
        case Types.REAL:
        case Types.DOUBLE:
        case Types.DATE:
        case Types.TIMESTAMP:
        case Types.JAVA_OBJECT:
        case Types.LONGVARCHAR:
        case Types.LONGVARBINARY:
        case Types.BLOB:
        case Types.CLOB:
        case Types.ARRAY:
        case Types.STRUCT:
        case Types.DISTINCT:
        case Types.REF:
        case Types.DATALINK:
            return false;

        default:
            return true;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:DataViewUtils.java

示例3: getSelectClauseNullString

@Override
public String getSelectClauseNullString(int sqlType) {
	String literal;
	switch ( sqlType ) {
		case Types.LONGVARCHAR:
		case Types.VARCHAR:
		case Types.CHAR:
			literal = "cast(null as varchar(100))";
			break;
		case Types.LONGVARBINARY:
		case Types.VARBINARY:
		case Types.BINARY:
			literal = "cast(null as varbinary(100))";
			break;
		case Types.CLOB:
			literal = "cast(null as clob)";
			break;
		case Types.BLOB:
			literal = "cast(null as blob)";
			break;
		case Types.DATE:
			literal = "cast(null as date)";
			break;
		case Types.TIMESTAMP:
			literal = "cast(null as timestamp)";
			break;
		case Types.BOOLEAN:
			literal = "cast(null as boolean)";
			break;
		case Types.BIT:
			literal = "cast(null as bit)";
			break;
		case Types.TIME:
			literal = "cast(null as time)";
			break;
		default:
			literal = "cast(null as int)";
	}
	return literal;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:40,代码来源:HSQLDialect.java

示例4: getNativeBinaryStream

/**
 * A column value can also be retrieved as a binary stream. This method is
 * suitable for retrieving LONGVARBINARY values.
 * 
 * @param columnIndex
 *            the first column is 1, the second is 2...
 * 
 * @return a Java InputStream that delivers the database column value as a
 *         stream of bytes. If the value is SQL NULL, then the result is
 *         null
 * 
 * @exception SQLException
 *                if a database access error occurs
 * 
 * @see getAsciiStream
 * @see getUnicodeStream
 */
protected InputStream getNativeBinaryStream(int columnIndex) throws SQLException {
    checkRowPos();

    int columnIndexMinusOne = columnIndex - 1;

    if (this.thisRow.isNull(columnIndexMinusOne)) {
        this.wasNullFlag = true;

        return null;
    }

    this.wasNullFlag = false;

    switch (this.fields[columnIndexMinusOne].getSQLType()) {
        case Types.BIT:
        case Types.BINARY:
        case Types.VARBINARY:
        case Types.BLOB:
        case Types.LONGVARBINARY:
            return this.thisRow.getBinaryInputStream(columnIndexMinusOne);
    }

    byte[] b = getNativeBytes(columnIndex, false);

    if (b != null) {
        return new ByteArrayInputStream(b);
    }

    return null;
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:47,代码来源:ResultSetImpl.java

示例5: fromSqlToJava

/**
    * Decode the String param type passed by user on client side into a Types
    * corresponding value.
    * 
    * @param sqlParamType
    * @return
    */
   public static int fromSqlToJava(String sqlParamType) {
int javaType = 0;

if (sqlParamType.equals(AceQLTypes.CHARACTER)) {
    javaType = Types.CHAR;
} else if (sqlParamType.equals(AceQLTypes.VARCHAR)) {
    javaType = Types.VARCHAR;
} else if (sqlParamType.equals(AceQLTypes.LONGVARCHAR)) {
    javaType = Types.LONGVARCHAR;
} else if (sqlParamType.equals(AceQLTypes.BIT)) {
    javaType = Types.BIT;
} else if (sqlParamType.equals(AceQLTypes.NUMERIC)) {
    javaType = Types.NUMERIC;
} else if (sqlParamType.equals(AceQLTypes.TINYINT)) {
    javaType = Types.TINYINT;
} else if (sqlParamType.equals(AceQLTypes.SMALLINT)) {
    javaType = Types.SMALLINT;
} else if (sqlParamType.equals(AceQLTypes.INTEGER)) {
    javaType = Types.INTEGER;
} else if (sqlParamType.equals(AceQLTypes.BIGINT)) {
    javaType = Types.BIGINT;
} else if (sqlParamType.equals(AceQLTypes.REAL)) {
    javaType = Types.REAL;
} else if (sqlParamType.equals(AceQLTypes.FLOAT)) {
    javaType = Types.FLOAT;
} else if (sqlParamType.equals(AceQLTypes.DOUBLE_PRECISION)) {
    javaType = Types.DOUBLE;
} else if (sqlParamType.equals(AceQLTypes.DATE)) {
    javaType = Types.DATE;
} else if (sqlParamType.equals(AceQLTypes.TIME)) {
    javaType = Types.TIME;
} else if (sqlParamType.equals(AceQLTypes.TIMESTAMP)) {
    javaType = Types.TIMESTAMP;
} else if (sqlParamType.equals(AceQLTypes.BINARY)) {
    javaType = Types.BINARY;
} else if (sqlParamType.equals(AceQLTypes.VARBINARY)) {
    javaType = Types.VARBINARY;
} else if (sqlParamType.equals(AceQLTypes.DATE)) {
    javaType = Types.LONGVARBINARY;
} else if (sqlParamType.equals(AceQLTypes.BLOB)) {
    javaType = Types.BLOB;
} else if (sqlParamType.equals(AceQLTypes.CLOB)) {
    javaType = Types.CLOB;
} else if (sqlParamType.startsWith("TYPE_NULL")) {
    String javaTypeStr = StringUtils.substringAfter(sqlParamType,
	    "TYPE_NULL");
    javaType = Integer.parseInt(javaTypeStr);
} else {
    throw new IllegalArgumentException(
	    "Unsuported data type for null setting: " + sqlParamType);
}
return javaType;
   }
 
开发者ID:kawansoft,项目名称:aceql-http,代码行数:60,代码来源:JavaSqlConversion.java

示例6: columnClassNames

@DataProvider(name = "columnClassNames")
private Object[][] columnClassNames() {
    return new Object[][]{
        {Types.CHAR, "java.lang.String"},
        {Types.NCHAR, "java.lang.String"},
        {Types.VARCHAR, "java.lang.String"},
        {Types.NVARCHAR, "java.lang.String"},
        {Types.LONGVARCHAR, "java.lang.String"},
        {Types.LONGNVARCHAR, "java.lang.String"},
        {Types.NUMERIC, "java.math.BigDecimal"},
        {Types.DECIMAL, "java.math.BigDecimal"},
        {Types.BIT, "java.lang.Boolean"},
        {Types.TINYINT, "java.lang.Byte"},
        {Types.SMALLINT, "java.lang.Short"},
        {Types.INTEGER, "java.lang.Integer"},
        {Types.FLOAT, "java.lang.Double"},
        {Types.DOUBLE, "java.lang.Double"},
        {Types.BINARY, "byte[]"},
        {Types.VARBINARY, "byte[]"},
        {Types.LONGVARBINARY, "byte[]"},
        {Types.DATE, "java.sql.Date"},
        {Types.TIME, "java.sql.Time"},
        {Types.TIMESTAMP, "java.sql.Timestamp"},
        {Types.CLOB, "java.sql.Clob"},
        {Types.BLOB, "java.sql.Blob"}

    };

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:RowSetMetaDataTests.java

示例7: testAllFieldsForNotNull

@SuppressWarnings("deprecation")
private void testAllFieldsForNotNull(ResultSet rsToTest, List<Boolean> wasDatetimeTypeList) throws Exception {
    ResultSetMetaData rsmd = this.rs.getMetaData();
    int numCols = rsmd.getColumnCount();

    while (rsToTest.next()) {
        for (int i = 0; i < numCols - 1; i++) {
            boolean wasDatetimeType = wasDatetimeTypeList.get(i).booleanValue();
            String typeName = rsmd.getColumnTypeName(i + 1);
            int sqlType = rsmd.getColumnType(i + 1);

            if (!"BIT".equalsIgnoreCase(typeName) && sqlType != Types.BINARY && sqlType != Types.VARBINARY && sqlType != Types.LONGVARBINARY) {
                if (!wasDatetimeType) {

                    assertEquals(false, rsToTest.getBoolean(i + 1));

                    assertTrue(!rsToTest.wasNull());

                    assertEquals(0, rsToTest.getDouble(i + 1), 0 /* delta */);
                    assertTrue(!rsToTest.wasNull());
                    assertEquals(0, rsToTest.getFloat(i + 1), 0 /* delta */);
                    assertTrue(!rsToTest.wasNull());
                    assertEquals(0, rsToTest.getInt(i + 1));
                    assertTrue(!rsToTest.wasNull());
                    assertEquals(0, rsToTest.getLong(i + 1));
                    assertTrue(!rsToTest.wasNull());
                    assertEquals(0, rsToTest.getByte(i + 1));
                    assertTrue(!rsToTest.wasNull());
                    assertEquals(0, rsToTest.getShort(i + 1));
                    assertTrue(!rsToTest.wasNull());
                }

                assertNotNull(rsToTest.getObject(i + 1));
                assertTrue(!rsToTest.wasNull());
                assertNotNull(rsToTest.getString(i + 1));
                assertTrue(!rsToTest.wasNull());
                assertNotNull(rsToTest.getAsciiStream(i + 1));
                assertTrue(!rsToTest.wasNull());

                assertNotNull(rsToTest.getBinaryStream(i + 1));
                assertTrue(!rsToTest.wasNull());
                assertNotNull(rsToTest.getBlob(i + 1));
                assertTrue(!rsToTest.wasNull());
                assertNotNull(rsToTest.getBytes(i + 1));
                assertTrue(!rsToTest.wasNull());
                assertNotNull(rsToTest.getCharacterStream(i + 1));
                assertTrue(!rsToTest.wasNull());
                assertNotNull(rsToTest.getClob(i + 1));
                assertTrue(!rsToTest.wasNull());

                String columnClassName = rsmd.getColumnClassName(i + 1);

                boolean canBeUsedAsDate = !("java.lang.Boolean".equals(columnClassName) || "java.lang.Double".equals(columnClassName)
                        || "java.lang.Float".equals(columnClassName) || "java.lang.Real".equals(columnClassName)
                        || "java.math.BigDecimal".equals(columnClassName));

                if (canBeUsedAsDate) {
                    assertNotNull(rsToTest.getDate(i + 1));
                    assertTrue(!rsToTest.wasNull());
                    assertNotNull(rsToTest.getTime(i + 1));
                    assertTrue(!rsToTest.wasNull());
                    assertNotNull(rsToTest.getTimestamp(i + 1));
                    assertTrue(!rsToTest.wasNull());
                }

                assertNotNull(rsToTest.getUnicodeStream(i + 1));
                assertTrue(!rsToTest.wasNull());

                try {
                    assertNotNull(rsToTest.getURL(i + 1));
                } catch (SQLException sqlEx) {
                    assertTrue(sqlEx.getMessage().indexOf("URL") != -1);
                }

                assertTrue(!rsToTest.wasNull());
            }
        }
    }
}
 
开发者ID:JuanJoseFJ,项目名称:ProyectoPacientes,代码行数:79,代码来源:ResultSetRegressionTest.java

示例8: testBug25715

/**
 * Tests fix for BUG#25715 - CallableStatements with OUT/INOUT parameters
 * that are "binary" have extra 7 bytes (which happens to be the _binary
 * introducer!)
 * 
 * @throws Exception
 *             if the test fails.
 */
public void testBug25715() throws Exception {
    if (!serverSupportsStoredProcedures()) {
        return; // no stored procs
    }

    createProcedure("spbug25715", "(INOUT mblob MEDIUMBLOB) BEGIN SELECT 1 FROM DUAL WHERE 1=0;\nEND");
    CallableStatement cstmt = null;

    try {
        cstmt = this.conn.prepareCall("{call spbug25715(?)}");

        byte[] buf = new byte[65];
        for (int i = 0; i < 65; i++) {
            buf[i] = 1;
        }
        int il = buf.length;

        int[] typesToTest = new int[] { Types.BIT, Types.BINARY, Types.BLOB, Types.JAVA_OBJECT, Types.LONGVARBINARY, Types.VARBINARY };

        for (int i = 0; i < typesToTest.length; i++) {

            cstmt.setBinaryStream("mblob", new ByteArrayInputStream(buf), buf.length);
            cstmt.registerOutParameter("mblob", typesToTest[i]);

            cstmt.executeUpdate();

            InputStream is = cstmt.getBlob("mblob").getBinaryStream();
            ByteArrayOutputStream bOut = new ByteArrayOutputStream();

            int bytesRead = 0;
            byte[] readBuf = new byte[256];

            while ((bytesRead = is.read(readBuf)) != -1) {
                bOut.write(readBuf, 0, bytesRead);
            }

            byte[] fromSelectBuf = bOut.toByteArray();

            int ol = fromSelectBuf.length;

            assertEquals(il, ol);
        }

        cstmt.close();
    } finally {

        if (cstmt != null) {
            cstmt.close();
        }
    }

}
 
开发者ID:Jugendhackt,项目名称:OpenVertretung,代码行数:60,代码来源:CallableStatementRegressionTest.java

示例9: getSqlTypeString

/**
 * Convert sql types to String for display
 *
 * @param sqlType the type number from java.sql.Types
 * @return the type name
 */
static public String getSqlTypeString(int sqlType) {
    switch (sqlType) {
        case Types.BIGINT:
            return "BIGINT"; //NOI18N
        case Types.BINARY:
            return "BINARY"; //NOI18N
        case Types.BIT:
            return "BIT"; //NOI18N
        case Types.NCHAR:
            return "NCHAR"; //NOI18N
        case Types.CHAR:
            return "CHAR"; //NOI18N
        case Types.DATE:
            return "DATE"; //NOI18N
        case Types.DECIMAL:
            return "DECIMAL"; //NOI18N
        case Types.DOUBLE:
            return "DOUBLE"; //NOI18N
        case Types.FLOAT:
            return "FLOAT"; //NOI18N
        case Types.INTEGER:
            return "INTEGER"; //NOI18N
        case Types.LONGVARBINARY:
            return "LONGVARBINARY"; //NOI18N
        case Types.LONGNVARCHAR:
            return "LONGNVARCHAR"; //NOI18N
        case Types.LONGVARCHAR:
            return "LONGVARCHAR"; //NOI18N
        case Types.NULL:
            return "NULL"; //NOI18N
        case Types.NUMERIC:
            return "NUMERIC"; //NOI18N
        case Types.OTHER:
            return "OTHER"; //NOI18N
        case Types.REAL:
            return "REAL"; //NOI18N
        case Types.SMALLINT:
            return "SMALLINT"; //NOI18N
        case Types.TIME:
            return "TIME"; //NOI18N
        case Types.TIMESTAMP:
            return "TIMESTAMP"; //NOI18N
        case Types.TINYINT:
            return "TINYINT"; //NOI18N
        case Types.VARBINARY:
            return "VARBINARY"; //NOI18N
        case Types.NVARCHAR:
            return "NVARCHAR";
        case Types.VARCHAR:
            return "VARCHAR"; //NOI18N
        case Types.JAVA_OBJECT:
            return "JAVA_OBJECT"; //NOI18N
        case Types.DISTINCT:
            return "DISTINCT"; //NOI18N
        case Types.STRUCT:
            return "STRUCT"; //NOI18N
        case Types.ARRAY:
            return "ARRAY"; //NOI18N
        case Types.BLOB:
            return "BLOB"; //NOI18N
        case Types.NCLOB:
            return "NCLOB";
        case Types.CLOB:
            return "CLOB"; //NOI18N
        case Types.REF:
            return "REF"; //NOI18N
        default:
            Logger.getLogger(SQLTypeUtil.class.getName()).log(Level.WARNING, "Unknown JDBC column type: {0}. Returns null.", sqlType);
            return "UNKNOWN"; //NOI18N
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:77,代码来源:SQLTypeUtil.java

示例10: getSQLType

int getSQLType()
{
	return Types.LONGVARBINARY;
}
 
开发者ID:costea7,项目名称:ChronoBike,代码行数:4,代码来源:ColValueBinaryStream.java

示例11: jdbcTypeToClass

/**
 * Get the Java type which corresponds to given SQL type.
 * @param type SQL type
 * @return The Java type
 */
public static Class<?> jdbcTypeToClass(int type) {
	Class<?> result = Object.class;

	switch (type) {
	case Types.CHAR:
	case Types.VARCHAR:
	case Types.LONGVARCHAR:
		result = String.class;
		break;

	case Types.NUMERIC:
	case Types.DECIMAL:
		result = java.math.BigDecimal.class;
		break;

	case Types.BIT:
		result = Boolean.class;
		break;

	case Types.TINYINT:
		result = Byte.class;
		break;

	case Types.SMALLINT:
		result = Short.class;
		break;

	case Types.INTEGER:
		result = Integer.class;
		break;

	case Types.BIGINT:
		result = Long.class;
		break;

	case Types.REAL:
	case Types.FLOAT:
		result = Float.class;
		break;

	case Types.DOUBLE:
		result = Double.class;
		break;

	case Types.BINARY:
	case Types.VARBINARY:
	case Types.LONGVARBINARY:
		result = byte[].class;
		break;

	case Types.DATE:
		result = java.sql.Date.class;
		break;

	case Types.TIME:
		result = java.sql.Time.class;
		break;

	case Types.TIMESTAMP:
		result = java.sql.Timestamp.class;
		break;
	default:
		break;
	}

	return result;
}
 
开发者ID:holon-platform,项目名称:holon-datastore-jdbc,代码行数:72,代码来源:JdbcDatastoreUtils.java

示例12: setInOutParamsOnServer

private void setInOutParamsOnServer() throws SQLException {
    synchronized (checkClosed().getConnectionMutex()) {
        if (this.paramInfo.numParameters > 0) {
            for (Iterator<CallableStatementParam> paramIter = this.paramInfo.iterator(); paramIter.hasNext();) {

                CallableStatementParam inParamInfo = paramIter.next();

                //Fix for 5.5+
                if (inParamInfo.isOut && inParamInfo.isIn) {
                    if ((inParamInfo.paramName == null) && (hasParametersView())) {
                        inParamInfo.paramName = "nullnp" + inParamInfo.index;
                    }

                    String inOutParameterName = mangleParameterName(inParamInfo.paramName);
                    StringBuilder queryBuf = new StringBuilder(4 + inOutParameterName.length() + 1 + 1);
                    queryBuf.append("SET ");
                    queryBuf.append(inOutParameterName);
                    queryBuf.append("=?");

                    PreparedStatement setPstmt = null;

                    try {
                        setPstmt = ((Wrapper) this.connection.clientPrepareStatement(queryBuf.toString())).unwrap(PreparedStatement.class);

                        if (this.isNull[inParamInfo.index]) {
                            setPstmt.setBytesNoEscapeNoQuotes(1, "NULL".getBytes());

                        } else {
                            byte[] parameterAsBytes = getBytesRepresentation(inParamInfo.index);

                            if (parameterAsBytes != null) {
                                if (parameterAsBytes.length > 8 && parameterAsBytes[0] == '_' && parameterAsBytes[1] == 'b' && parameterAsBytes[2] == 'i'
                                        && parameterAsBytes[3] == 'n' && parameterAsBytes[4] == 'a' && parameterAsBytes[5] == 'r'
                                        && parameterAsBytes[6] == 'y' && parameterAsBytes[7] == '\'') {
                                    setPstmt.setBytesNoEscapeNoQuotes(1, parameterAsBytes);
                                } else {
                                    int sqlType = inParamInfo.desiredJdbcType;

                                    switch (sqlType) {
                                        case Types.BIT:
                                        case Types.BINARY:
                                        case Types.BLOB:
                                        case Types.JAVA_OBJECT:
                                        case Types.LONGVARBINARY:
                                        case Types.VARBINARY:
                                            setPstmt.setBytes(1, parameterAsBytes);
                                            break;
                                        default:
                                            // the inherited PreparedStatement methods have already escaped and quoted these parameters
                                            setPstmt.setBytesNoEscape(1, parameterAsBytes);
                                    }
                                }
                            } else {
                                setPstmt.setNull(1, Types.NULL);
                            }
                        }

                        setPstmt.executeUpdate();
                    } finally {
                        if (setPstmt != null) {
                            setPstmt.close();
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:bragex,项目名称:the-vigilantes,代码行数:68,代码来源:CallableStatement.java

示例13: 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

示例14: toHCatType

/**
 * Resolve a database-specific type to HCat data type. Largely follows Sqoop's
 * hive translation.
 * @param sqlType
 *          sql type
 * @return hcat type
 */
public static String toHCatType(int sqlType) {
  switch (sqlType) {

  // Ideally TINYINT and SMALLINT should be mapped to their
  // HCat equivalents tinyint and smallint respectively
  // But the Sqoop Java type conversion has them mapped to Integer
  // Even though the referenced Java doc clearly recommends otherwise.
  // Changing this now can cause many of the sequence file usages to
  // break as value class implementations will change. So, we
  // just use the same behavior here.
    case Types.SMALLINT:
    case Types.TINYINT:
    case Types.INTEGER:
      return "int";

    case Types.VARCHAR:
      return "varchar";
    case Types.CHAR:
      return "char";
    case Types.LONGVARCHAR:
    case Types.NVARCHAR:
    case Types.NCHAR:
    case Types.LONGNVARCHAR:
    case Types.DATE:
    case Types.TIME:
    case Types.TIMESTAMP:
    case Types.CLOB:
      return "string";

    case Types.FLOAT:
    case Types.REAL:
      return "float";

    case Types.NUMERIC:
    case Types.DECIMAL:
      return "decimal";

    case Types.DOUBLE:
      return "double";

    case Types.BIT:
    case Types.BOOLEAN:
      return "boolean";

    case Types.BIGINT:
      return "bigint";

    case Types.BINARY:
    case Types.VARBINARY:
    case Types.BLOB:
    case Types.LONGVARBINARY:
      return "binary";

    default:
      throw new IllegalArgumentException(
        "Cannot convert SQL type to HCatalog type " + sqlType);
  }
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:65,代码来源:SqoopHCatUtilities.java

示例15: isBinaryColumn

/**
    * Returns true if the column is a binary type
    * 
    * @param columnType
    *            the sql column type
    * @param columnName
    *            the sql column name
    * @param columnTable
    *            the table name of the column
    * @return true if it's a binary type
    */
   private static boolean isBinaryColumn(int columnType) {
if (columnType == Types.BINARY || columnType == Types.VARBINARY
	|| columnType == Types.LONGVARBINARY
	|| columnType == Types.BLOB) {
    return true;
} else {
    return false;
}
   }
 
开发者ID:kawansoft,项目名称:aceql-http,代码行数:20,代码来源:ResultSetPrinter.java


注:本文中的java.sql.Types.LONGVARBINARY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。