Hello,

is the problem reproducable, or occurs it randomly?

If its reproducable, would you mind creating a VTrace?
(see http://sapdb.2scale.net/moin.cgi/VTrace on howto do it)

The question is whether the data is already corrupted (that '1'
in the number shown in the error message) on server side, or
there are some Java quirks that create this (of course not
in FIXED(18,8)) number.

Regards

Alexander Schr�der
SAP DB, SAP Labs Berlin 

BTW - which locale are you using (as there comes not the right error 
message out, and there should be english messages in this case ...)


> -----Original Message-----
> From: Thomas Rohwer [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 28, 2003 3:13 PM
> To: [EMAIL PROTECTED]
> Subject: Bug in JDBC Driver: Calling getBigDecimal results in
> ConversionExceptionSapDB
> 
> 
> Hello,
> 
> running the following program
> 
> import java.sql.*;
> import java.math.*;
> 
> 
> public class Bug {
>      public static void main(String[] args) throws Exception {
>          String table= "TESTXTAB";
> 
>          Class cls= Class.forName("com.sap.dbtech.jdbc.DriverSapDB");
> 
>          Connection conn= 
> DriverManager.getConnection("jdbc:sapdb://myhost/mydatabase", 
> "user", "passwd")
> 
>          PreparedStatement stm;
>          stm= conn.prepareStatement("DROP TABLE "+table);
>          try{
>              stm.executeUpdate();
>              stm.close();
>          } catch(SQLException e) {
>          }
>          stm= conn.prepareStatement("CREATE TABLE "+table+" 
> (val FIXED(18,8))");
>          stm.executeUpdate();
>          stm.close();
> 
>          stm= conn.prepareStatement("INSERT INTO "+table+" 
> (val) values (?)");
>          stm.setBigDecimal(1, new BigDecimal("-25.00"));
>          stm.executeUpdate();
>          stm.close();
> 
>          stm= conn.prepareStatement("SELECT * FROM "+table);
>          ResultSet rs= stm.executeQuery();
>          while (rs.next()) {
>              System.out.println(rs.getBigDecimal(1));
>          }
>      }
> }
> 
> yields
> 
> Exception in thread "main" 
> com.sap.dbtech.jdbc.translators.ConversionExceptionSapDB: No 
> message available for default locale for key 
> error.conversion.data, arguments [-25.0000000000000010 scale: 
> 8, FIXED].
>          at 
> com.sap.dbtech.jdbc.translators.DBTechTranslator.newParseExcep
> tion(DBTechTranslator.java:1155)
>          at 
> com.sap.dbtech.jdbc.translators.ShortNumericTranslator.getBigD
> ecimal(ShortNumericTranslator.java:90)
>          at 
> com.sap.dbtech.jdbc.ResultSetSapDB.getBigDecimal(ResultSetSapD
> B.java:707)
>          at Bug.main(Bug.java:32)
> 
> 
> This seems to be a bug in the JDBC driver. Using getString 
> instead of getBigDecimal does not give in an error.
> 
> Sincerely,
> 
> Thomas Rohwer
> 
> 
> -- 
> MaxDB Discussion Mailing List
> For list archives: http://lists.mysql.com/maxdb
> To unsubscribe:    
http://lists.mysql.com/[EMAIL PROTECTED]

--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to