Java Code Examples for java.sql.Types#INTEGER

The following examples show how to use java.sql.Types#INTEGER . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ResultSetMetaData.java    From r-course with MIT License 6 votes vote down vote up
/**
 * Is the column a signed number?
 * 
 * @param column
 *            the first column is 1, the second is 2...
 * 
 * @return true if so
 * 
 * @throws SQLException
 *             if a database access error occurs
 */
public boolean isSigned(int column) throws SQLException {
    Field f = getField(column);
    int sqlType = f.getSQLType();

    switch (sqlType) {
        case Types.TINYINT:
        case Types.SMALLINT:
        case Types.INTEGER:
        case Types.BIGINT:
        case Types.FLOAT:
        case Types.REAL:
        case Types.DOUBLE:
        case Types.NUMERIC:
        case Types.DECIMAL:
            return !f.isUnsigned();

        case Types.DATE:
        case Types.TIME:
        case Types.TIMESTAMP:
            return false;

        default:
            return false;
    }
}
 
Example 2
Source File: IndexedColumnFactory.java    From bigtable-sql with Apache License 2.0 6 votes vote down vote up
public static boolean isOrderable(ColumnDisplayDefinition columnDisplayDefinition)
{
   switch(columnDisplayDefinition.getSqlType())
   {
      case Types.INTEGER:
      case Types.BIGINT:
      case Types.SMALLINT:
      case Types.DOUBLE:
      case Types.DECIMAL:
      case Types.FLOAT:
      case Types.NUMERIC:
      case Types.TIME:
      case Types.TIMESTAMP:
      case Types.DATE:
      case Types.BIT:
      case Types.BOOLEAN:
         return true;
      default:
         return false;
   }
}
 
Example 3
Source File: SqlTests.java    From calcite with Apache License 2.0 6 votes vote down vote up
private static ColumnMetaData.Rep rep(int columnType) {
  switch (columnType) {
  case Types.BOOLEAN:
    return ColumnMetaData.Rep.BOOLEAN;
  case Types.TINYINT:
    return ColumnMetaData.Rep.BYTE;
  case Types.SMALLINT:
    return ColumnMetaData.Rep.SHORT;
  case Types.INTEGER:
    return ColumnMetaData.Rep.INTEGER;
  case Types.BIGINT:
    return ColumnMetaData.Rep.LONG;
  case Types.REAL:
    return ColumnMetaData.Rep.FLOAT;
  case Types.DOUBLE:
    return ColumnMetaData.Rep.DOUBLE;
  case Types.TIME:
    return ColumnMetaData.Rep.JAVA_SQL_TIME;
  case Types.TIMESTAMP:
    return ColumnMetaData.Rep.JAVA_SQL_TIMESTAMP;
  case Types.DATE:
    return ColumnMetaData.Rep.JAVA_SQL_DATE;
  default:
    return ColumnMetaData.Rep.OBJECT;
  }
}
 
Example 4
Source File: TernaryOperatorNode.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
/**
 * Bind TIMESTAMPADD expression.  
 *
 * @return	The new top of the expression tree.
 *
 * @exception StandardException		Thrown on error
 */

	private ValueNode timestampAddBind() 
		throws StandardException
{
       if( ! bindParameter( rightOperand, Types.INTEGER))
       {
           int jdbcType = rightOperand.getTypeId().getJDBCTypeId();
           if( jdbcType != Types.TINYINT && jdbcType != Types.SMALLINT &&
               jdbcType != Types.INTEGER && jdbcType != Types.BIGINT)
               throw StandardException.newException(SQLState.LANG_INVALID_FUNCTION_ARG_TYPE,
                                                    rightOperand.getTypeId().getSQLTypeName(),
                                                    ReuseFactory.getInteger( 2),
                                                    operator);
       }
       bindDateTimeArg( receiver, 3);
       setType(DataTypeDescriptor.getBuiltInDataTypeDescriptor( Types.TIMESTAMP));
       return this;
   }
 
Example 5
Source File: ChartGenericJsonQuery.java    From core with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void addColumn(String columnName, int type) {
	if (columnName.equals("tooltip"))
		jsonBuilder.addTooltipColumn();
	else if (type == Types.NUMERIC || type == Types.INTEGER
			|| type == Types.SMALLINT || type == Types.BIGINT
			|| type == Types.FLOAT || type == Types.DOUBLE)
		jsonBuilder.addNumberColumn(columnName);
	else if (type == Types.VARCHAR)
		jsonBuilder.addStringColumn(columnName);
	else
		logger.error("Unknown type={} for columnName={}");
}
 
Example 6
Source File: MessageDaoImpl.java    From web-qq with Apache License 2.0 5 votes vote down vote up
public List<Message> getMessage(User sendUser, User receiveUser, Page page) throws WebQQDaoException {
    try {
        Map<String,User> map = Maps.newHashMap();
        map.put(sendUser.getId(),sendUser);
        map.put(receiveUser.getId(),receiveUser);

        Object[] args = new Object[]{
                sendUser.getId(),
                receiveUser.getId(),
                receiveUser.getId(),
                sendUser.getId(),
                page.getCurrentPage(),
                page.getPageSize()
        };
        int[] argTypes = new int[]{
                Types.VARCHAR,
                Types.VARCHAR,
                Types.VARCHAR,
                Types.VARCHAR,
                Types.INTEGER,
                Types.INTEGER
        };
        return jdbcTemplate.query(
                SQL_GET_MESSAGE_PAGE,
                args,
                argTypes,
                (rs, i) -> getMessageByResultSet(rs)
                        .setSendUser(map.get(rs.getString("sendUserId")))
                        .setReceiveUser(map.get(rs.getString("receiveUserId")))
        );
    } catch (Exception ex) {
        throw new WebQQDaoException(SQL_GET_MESSAGE_PAGE,ex);
    }

}
 
Example 7
Source File: SFResultSetMetaData.java    From snowflake-jdbc with Apache License 2.0 5 votes vote down vote up
private Integer calculatePrecision(SnowflakeColumnMetadata columnMetadata)
{
  int columnType = columnMetadata.getType();
  switch (columnType)
  {
    case Types.CHAR:
    case Types.VARCHAR:
    case Types.BINARY:
      return columnMetadata.getLength();
    case Types.INTEGER:
    case Types.DECIMAL:
    case Types.BIGINT:
      return columnMetadata.getPrecision();
    case Types.DATE:
      return dateStringLength;
    case Types.TIME:
      return timeStringLength;
    case SnowflakeUtil.EXTRA_TYPES_TIMESTAMP_LTZ:
      return timestampLTZStringLength;
    case SnowflakeUtil.EXTRA_TYPES_TIMESTAMP_TZ:
      return timestampTZStringLength;
    case Types.TIMESTAMP:
      return timestampNTZStringLength;
    // for double and boolean
    // Precision is not applicable hence return 0
    default:
      return 0;
  }
}
 
Example 8
Source File: DataTypeUtil.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Converts an ODI type class to its corresponding 
 * ODA data type code. <br>
 * <b>ODI Type Class -> ODA Data Type</b><br>
 * <i>java.lang.Integer -> Integer<br>
 * java.lang.Double -> Double<br>
 * java.lang.String -> Character<br>
 * java.math.BigDecimal -> Decimal<br>
 * java.util.Date -> Timestamp<br>
    * java.sql.Date -> Date<br>
 * java.sql.Time -> Time<br>
 * java.sql.Timestamp -> Timestamp<br>
 * java.sql.Blob -> Blob<br>
 * java.sql.Clob -> Clob<br>
    * java.lang.Boolean -> Boolean<br>
    * java.lang.Object -> JavaObject<br>
    * </i><br>
 * All other type classes are mapped to the ODA String data type.
 * @param odiTypeClass  a type class used by the Data Engine ODI component
 * @return  the ODA data type that maps to the ODI type class.
 */
public static int toOdaDataType( Class odiTypeClass )
{
	int odaType = Types.CHAR; // default

	if ( odiTypeClass == null )
		odaType = Types.CHAR;
	else if ( odiTypeClass == String.class )
		odaType = Types.CHAR;
	else if ( odiTypeClass == Integer.class )
		odaType = Types.INTEGER;
	else if ( odiTypeClass == Double.class )
		odaType = Types.DOUBLE;
	else if ( odiTypeClass == BigDecimal.class )
		odaType = Types.DECIMAL;
	else if ( odiTypeClass == Time.class )
		odaType = Types.TIME;
	else if ( odiTypeClass == Timestamp.class )
		odaType = Types.TIMESTAMP;
       else if ( odiTypeClass == java.sql.Date.class )
           odaType = Types.DATE;
       else if ( odiTypeClass == java.util.Date.class )
           odaType = Types.TIMESTAMP;        
	else if ( odiTypeClass == Blob.class )
		odaType = Types.BLOB;
	else if ( odiTypeClass == Clob.class )
		odaType = Types.CLOB;
       else if ( odiTypeClass == Boolean.class )
           odaType = Types.BOOLEAN;
       else if ( odiTypeClass == Object.class )
           odaType = Types.JAVA_OBJECT;

	return odaType;
}
 
Example 9
Source File: SingleTableSplitUtil.java    From DataLink with Apache License 2.0 5 votes vote down vote up
private static boolean isLongType(int type) {
    boolean isValidLongType = type == Types.BIGINT || type == Types.INTEGER
            || type == Types.SMALLINT || type == Types.TINYINT;

    switch (SingleTableSplitUtil.DATABASE_TYPE) {
        case Oracle:
            isValidLongType |= type == Types.NUMERIC;
            break;
        default:
            break;
    }
    return isValidLongType;
}
 
Example 10
Source File: YuGongUtils.java    From yugong with GNU General Public License v2.0 5 votes vote down vote up
public static boolean isNumber(int sqlType) {
    if (sqlType == Types.TINYINT || sqlType == Types.SMALLINT || sqlType == Types.INTEGER
        || sqlType == Types.BIGINT || sqlType == Types.NUMERIC || sqlType == Types.DECIMAL) {
        return true;
    } else {
        return false;
    }
}
 
Example 11
Source File: Cursor.java    From vertx-sql-client with Apache License 2.0 5 votes vote down vote up
public final short getShort(int column) throws SQLException {
    switch (jdbcTypes_[column - 1]) {
    case Types.BOOLEAN:
        return CrossConverters.getShortFromBoolean(get_BOOLEAN(column));
    case Types.SMALLINT:
        return get_SMALLINT(column);
    case Types.INTEGER:
        return CrossConverters.getShortFromInt(get_INTEGER(column));
    case Types.BIGINT:
        return CrossConverters.getShortFromLong(get_BIGINT(column));
    case Types.REAL:
        return CrossConverters.getShortFromFloat(get_FLOAT(column));
    case Types.DOUBLE:
        return CrossConverters.getShortFromDouble(get_DOUBLE(column));
    case Types.DECIMAL:
        // For performance we don't materialize the BigDecimal, but convert directly from decimal bytes to a long.
        return CrossConverters.getShortFromLong(
            getLongFromDECIMAL(column, "short"));
    case Types.CHAR:
        return CrossConverters.getShortFromString(get_CHAR(column));
    case Types.VARCHAR:
    case Types.LONGVARCHAR:
        return CrossConverters.getShortFromString(get_VARCHAR(column));
    default:
        throw coercionError( "short", column );
    }
}
 
Example 12
Source File: JdbcUtils.java    From effectivejava with Apache License 2.0 5 votes vote down vote up
/**
 * Check whether the given SQL type is numeric.
 * @param sqlType the SQL type to be checked
 * @return whether the type is numeric
 */
public static boolean isNumeric(int sqlType) {
	return Types.BIT == sqlType || Types.BIGINT == sqlType || Types.DECIMAL == sqlType ||
			Types.DOUBLE == sqlType || Types.FLOAT == sqlType || Types.INTEGER == sqlType ||
			Types.NUMERIC == sqlType || Types.REAL == sqlType || Types.SMALLINT == sqlType ||
			Types.TINYINT == sqlType;
}
 
Example 13
Source File: JdbcTypeConverterTest.java    From Alink with Apache License 2.0 5 votes vote down vote up
@Test
public void testMutualConversion() {
    int[] types = new int[]{ Types.VARCHAR, Types.BOOLEAN,
            Types.TINYINT, Types.SMALLINT, Types.INTEGER, Types.BIGINT, Types.FLOAT,
            Types.DOUBLE, Types.DATE, Types.TIME, Types.TIMESTAMP, Types.DECIMAL, Types.BINARY};

    for (int type : types) {
        TypeInformation<?> flinkType = JdbcTypeConverter.getFlinkType(type);
        int sqlType = JdbcTypeConverter.getIntegerSqlType(flinkType);
        Assert.assertEquals(type, sqlType);
    }
}
 
Example 14
Source File: ResultSetMetaData.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public int getColumnType( int index ) throws OdaException
{
	logger.logp( java.util.logging.Level.FINEST,
			ResultSetMetaData.class.getName( ),
			"getColumnType",
			"ResultSetMetaData.getColumnType( )" );
	assertNotNull( rsMetadata );
	try
	{
		int reType = getColumnTypeForSpecialJDBCDriver( index );
		if ( reType != Types.OTHER )
			return reType;
			
		reType = rsMetadata.getColumnType( index );

		if ( reType == Types.DECIMAL )
		{
			int scale = rsMetadata.getScale( index );
			int precision = rsMetadata.getPrecision( index );

			if ( ( scale == 0 ) && ( precision > 0 ) && ( precision <= 9 ) )
			{
				reType = Types.INTEGER;
			}
			else if ( precision > 9 && precision <= 15 )
			{
				reType = Types.DOUBLE;
			}
			else if ( precision > 15 )
			{
				reType = Types.DECIMAL;
			}
		}
		/* redirect the call to JDBC ResultSetMetaData.getColumnType(int) */
		return reType;
	}
	catch ( SQLException e )
	{
		throw new JDBCException( ResourceConstants.COLUMN_TYPE_CANNOT_GET,
				e );
	}

}
 
Example 15
Source File: SqlTypesUtils.java    From sqoop-on-spark with Apache License 2.0 4 votes vote down vote up
/**
 * Convert given java.sql.Types number into internal data type.
 *
 * @param sqlType java.sql.Types constant
 * @param columnName column name
 *
 * @return Concrete Column implementation
 */
public static Column sqlTypeToSchemaType(int sqlType, String columnName, int precision, int scale) {
  switch (sqlType) {
    case Types.SMALLINT:
    case Types.TINYINT:
      // only supports signed values
      return new FixedPoint(columnName, 2L, true);
    case Types.INTEGER:
      // only supports signed values
      return new FixedPoint(columnName, 4L, true);
    case Types.BIGINT:
      return new FixedPoint(columnName, 8L, true);

    case Types.CLOB:
    case Types.VARCHAR:
    case Types.CHAR:
    case Types.LONGVARCHAR:
    case Types.NVARCHAR:
    case Types.NCHAR:
    case Types.LONGNVARCHAR:
      return new Text(columnName);

    case Types.DATE:
      return new Date(columnName);

    case Types.TIME:
      return new Time(columnName, true);

    case Types.TIMESTAMP:
      return new DateTime(columnName, true, false);

    case Types.FLOAT:
    case Types.REAL:
      return new FloatingPoint(columnName, 4L);
    case Types.DOUBLE:
      return new FloatingPoint(columnName, 8L);

    case Types.NUMERIC:
    case Types.DECIMAL:
      return new Decimal(columnName, precision, scale);

    case Types.BIT:
    case Types.BOOLEAN:
      return new Bit(columnName);

    case Types.BINARY:
    case Types.VARBINARY:
    case Types.BLOB:
    case Types.LONGVARBINARY:
      return new Binary(columnName);

    default:
      return new Unknown(columnName,(long)sqlType);
  }
}
 
Example 16
Source File: TypeConverter.java    From jpa-entity-generator with MIT License 4 votes vote down vote up
public static String toJavaType(int typeCode) {
    switch (typeCode) {
        case Types.ARRAY:
            return "Array";
        case Types.BIGINT:
            return "Long";
        // case Types.BINARY:
        case Types.BIT:
            // return "Boolean";
            return "boolean";
        case Types.BLOB:
            return "Blob";
        case Types.BOOLEAN:
            return "Boolean";
        case Types.CHAR:
            return "String";
        case Types.CLOB:
            return "Clob";
        // case Types.DATALINK:
        case Types.DATE:
            return "Date";
        case Types.DECIMAL:
            return "java.math.BigDecimal";
        // case Types.DISTINCT:
        case Types.DOUBLE:
            return "Double";
        case Types.FLOAT:
            return "Float";
        case Types.INTEGER:
            return "Integer";
        // case Types.JAVA_OBJECT:
        // case Types.LONGNVARCHAR:
        // case Types.LONGVARBINARY:
        case Types.LONGVARCHAR:
            return "String";
        // case Types.NCHAR:
        // case Types.NCLOB:
        // case Types.NULL:
        case Types.NUMERIC:
            return "java.math.BigDecimal";
        // case Types.NVARCHAR:
        // case Types.OTHER:
        case Types.REAL:
            return "Float";
        case Types.REF:
            return "Ref";
        // case Types.REF_CURSOR:
        // case Types.ROWID:
        case Types.SMALLINT:
            return "Short";
        // case Types.SQLXML:
        case Types.STRUCT:
            return "Struct";
        case Types.TIME:
            return "Time";
        case Types.TIME_WITH_TIMEZONE:
            return "Time";
        case Types.TIMESTAMP:
            return "Timestamp";
        case Types.TIMESTAMP_WITH_TIMEZONE:
            return "Timestamp";
        case Types.TINYINT:
            return "Byte";
        // case Types.VARBINARY:
        case Types.VARCHAR:
            return "String";
        default:
            return "String";
    }
}
 
Example 17
Source File: GemFireXDManager.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
/**
 * 
 * @param sqlType
 *          Type of the column as defined in GemFireXD table.
 * @param pxfType
 *          Type of the column as defined in PXF external table.
 * @return True if columns' types match. False otherwise.
 */
public static boolean matchColumnTypes(int sqlType, int pxfType) {
  switch (DataType.get(pxfType)) {
  case SMALLINT:
    return sqlType == Types.SMALLINT;

  case INTEGER:
    return sqlType == Types.INTEGER;

  case BIGINT:
    return sqlType == Types.BIGINT;

  case REAL:
    return sqlType == Types.REAL;

  case FLOAT8:
    return sqlType == Types.DOUBLE;

  case VARCHAR:
    return sqlType == Types.VARCHAR;

  case BOOLEAN:
    return sqlType == Types.BOOLEAN;

  case NUMERIC:
    return sqlType == Types.NUMERIC;

  case TIMESTAMP:
    return sqlType == Types.TIMESTAMP;

  case BPCHAR:
    return sqlType == Types.VARCHAR || sqlType == Types.CHAR;

  case BYTEA:
    // http://www.public.iastate.edu/~java/docs/guide/jdbc/mapping.doc.html
    return sqlType == Types.BINARY || sqlType == Types.BLOB;

  case TEXT:
    return sqlType == Types.VARCHAR;

  case DATE:
    return sqlType == Types.DATE;

  case TIME:
    return sqlType == Types.TIME;

  default:
    break;
  }
  return false;
}
 
Example 18
Source File: Converters.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
/**
 * Get {@link GFXDType} for given JDBC {@link Types}.
 */
public static GFXDType getThriftSQLType(int jdbcType) {
  switch (jdbcType) {
    case Types.ARRAY:
      return GFXDType.ARRAY;
    case Types.BIGINT:
      return GFXDType.BIGINT;
    case Types.BINARY:
      return GFXDType.BINARY;
    case Types.BIT:
      return GFXDType.BOOLEAN;
    case Types.BLOB:
      return GFXDType.BLOB;
    case Types.BOOLEAN:
      return GFXDType.BOOLEAN;
    case Types.CHAR:
      return GFXDType.CHAR;
    case Types.CLOB:
      return GFXDType.CLOB;
    case Types.DATALINK:
      return GFXDType.DATALINK;
    case Types.DATE:
      return GFXDType.DATE;
    case Types.DECIMAL:
      return GFXDType.DECIMAL;
    case Types.DISTINCT:
      return GFXDType.DISTINCT;
    case Types.DOUBLE:
      return GFXDType.DOUBLE;
    case Types.FLOAT:
      return GFXDType.FLOAT;
    case Types.INTEGER:
      return GFXDType.INTEGER;
    case Types.JAVA_OBJECT:
      return GFXDType.JAVA_OBJECT;
    case TYPE_JSON_OBJECT:
      return GFXDType.JSON_OBJECT;
    case Types.LONGNVARCHAR:
      return GFXDType.LONGNVARCHAR;
    case Types.LONGVARBINARY:
      return GFXDType.LONGVARBINARY;
    case Types.LONGVARCHAR:
      return GFXDType.LONGVARCHAR;
    case Types.NCHAR:
      return GFXDType.NCHAR;
    case Types.NCLOB:
      return GFXDType.NCLOB;
    case Types.NULL:
      return GFXDType.NULLTYPE;
    case Types.NUMERIC:
      return GFXDType.DECIMAL;
    case Types.NVARCHAR:
      return GFXDType.NVARCHAR;
    case Types.OTHER:
      return GFXDType.OTHER;
    case TYPE_PDX_OBJECT:
      return GFXDType.PDX_OBJECT;
    case Types.REAL:
      return GFXDType.REAL;
    case Types.REF:
      return GFXDType.REF;
    case Types.ROWID:
      return GFXDType.ROWID;
    case Types.SMALLINT:
      return GFXDType.SMALLINT;
    case Types.SQLXML:
      return GFXDType.SQLXML;
    case Types.STRUCT:
      return GFXDType.STRUCT;
    case Types.TIME:
      return GFXDType.TIME;
    case Types.TIMESTAMP:
      return GFXDType.TIMESTAMP;
    case Types.TINYINT:
      return GFXDType.TINYINT;
    case Types.VARBINARY:
      return GFXDType.VARBINARY;
    case Types.VARCHAR:
      return GFXDType.VARCHAR;
    default:
      return GFXDType.OTHER;
  }
}
 
Example 19
Source File: JdbcWritableConverter.java    From DataVec with Apache License 2.0 4 votes vote down vote up
public static Writable convert(final Object columnValue, final int columnType) {
    switch (columnType) {
        case Types.BOOLEAN:
            return new BooleanWritable((boolean) columnValue);

        case Types.DATE:
        case Types.TIME:
        case Types.TIMESTAMP:
        case Types.CHAR:
        case Types.LONGVARCHAR:
        case Types.LONGNVARCHAR:
        case Types.NCHAR:
        case Types.NVARCHAR:
        case Types.VARCHAR:
            return new Text(columnValue.toString());

        case Types.FLOAT:
        case Types.REAL:
            return new FloatWritable((float) columnValue);

        case Types.DECIMAL:
        case Types.NUMERIC:
            return new DoubleWritable(((BigDecimal) columnValue).doubleValue()); //!\ This may overflow

        case Types.DOUBLE:
            return new DoubleWritable((double) columnValue);

        case Types.INTEGER:
        case Types.SMALLINT:
        case Types.TINYINT:
            return new IntWritable((int) columnValue);

        case Types.BIT:
            return new BooleanWritable((boolean) columnValue);

        case Types.BIGINT:
            return new LongWritable((long) columnValue);

        default:
            throw new IllegalArgumentException("Column type unknown");
    }
}
 
Example 20
Source File: ExcelInsertQuery.java    From micro-integrator with Apache License 2.0 4 votes vote down vote up
private synchronized int executeSQL() throws SQLException {
    int rowCount = 0;
    if (!(getConnection() instanceof TExcelConnection)) {
        throw new SQLException("Connection does not refer to a Excel connection");
    }
    TExcelConnection excelConnection = (TExcelConnection) this.getConnection();
    //begin transaction,
    excelConnection.beginExcelTransaction();
    Workbook workbook = excelConnection.getWorkbook();
    Sheet sheet = workbook.getSheet(getTargetTableName());
    if (sheet == null) {
        throw new SQLException("Excel sheet named '" + this.getTargetTableName() +
                "' does not exist");
    }
    int lastRowNo = sheet.getLastRowNum();

    if (getParameters() != null) {
        Row row = sheet.createRow(lastRowNo + 1);
        for (ParamInfo param : getParameters()) {
            Cell cell = row.createCell(param.getOrdinal());
            switch (param.getSqlType()) {
                case Types.VARCHAR:
                    cell.setCellValue((String) param.getValue());
                    break;
                case Types.INTEGER:
                    cell.setCellValue((Integer) param.getValue());
                    break;
                case Types.DOUBLE:
                    cell.setCellValue((Double) param.getValue());
                    break;
                case Types.BOOLEAN:
                    cell.setCellValue((Boolean) param.getValue());
                    break;
                case Types.DATE:
                    cell.setCellValue((Date) param.getValue());
                    break;
                default:
                    cell.setCellValue((String) param.getValue());
                    break;
            }
        }
        rowCount++;
    }
    TDriverUtil.writeRecords(workbook, ((TExcelConnection) getConnection()).getPath());
    return rowCount;
}