Link to home
Start Free TrialLog in
Avatar of dolphin_g
dolphin_g

asked on

SYBASE Server EnterPrise Anywhere - JDBC 3.0 - executeUpdate

I'm trying to execute a stored procedure which basically does an insert. I've cooem across the following exception most of the time.


com.sybase.jdbc3.jdbc.SybSQLException: Arithmetic overflow during implicit conversion of SMALLINT value '340' to a TINYINT field .

      at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
      at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
      at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source)
      at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
      at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
      at com.sybase.jdbc3.jdbc.SybStatement.updateLoop(Unknown Source)
      at com.sybase.jdbc3.jdbc.SybCallableStatement.executeUpdate(Unknown Source)
      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)

SERVER : JBOSS EAP 4.2

This works fine when trying to update on the SYBASE SQL advantage. these are the input parameters
to the stored procedure.

@bas_activity_id      varchar
@account_id      numeric
@bas_account_id      varchar
@data_source_id      smallint
@data_source_name      varchar
@activity_type_id      smallint
@bas_corp_action_decl_id      varchar
@corp_action_decl_id      numeric
@mny_fund_id      int
@mny_bas_fund_id      varchar
@mny_currency_cd      char
@mny_currency_id      smallint
@mny_bas_currency_id      varchar
@sec_fund_id      int
@sec_bas_fund_id      varchar
@sec_currency_cd      char
@sec_currency_id      smallint
@sec_bas_currency_id      varchar
@margin_ind      bit
@short_ind      bit
@external_ind      bit
@cancel_ind      bit
@effective_dt      datetime
@tax_dt      datetime
@business_dt      datetime
@security_id      numeric
@cusip_      char
@symbol_      char
@isin_      char
@other_security_id      char
@market_group_id      smallint
@bas_market_group_id      varchar
@security_asset_class_id      numeric
@bas_asset_class_id      varchar
@security_name      varchar
@advisor_id      numeric
@advisor_cd      varchar
@business_unit_id      numeric
@business_unit_cd      varchar
@user_id      numeric
@trailer_      varchar
@share_qty      numeric
@delta_amount      numeric
@commission_      numeric
@fee_      numeric
@misc_fee      numeric
@principal_      numeric
@cost_basis      numeric
@bas_ts      datetime
@msg_pgm      varchar
@msg_ts      datetime
@orig_activity_id      numeric
@related_activity_type_id      smallint
@exchange_rate      numeric
@activity_id      numeric
      
ASKER CERTIFIED SOLUTION
Avatar of grant300
grant300

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dolphin_g
dolphin_g

ASKER

Found the problem. the problem was the JDBC and SQL datatype mapping for BIT fields in sql. I was mapping them as BYTE  - BIT. Modified it to BOOLEAN - BIT for JDBC 3.0.