|
|
Choosing A Webhost: |
RE: Bug in JDBC Driver: Calling getBigDecimal results in Conversi onExcepti: msg#00441db.maxdb
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:tr@xxxxxx] > Sent: Tuesday, October 28, 2003 3:13 PM > To: maxdb@xxxxxxxxxxxxxxx > 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/maxdb?unsub=alexander.schroeder@xxxxxxx -- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/maxdb?unsub=gcdm-maxdb@xxxxxxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Resume of sapdb after resume of computer, Schroeder, Alexander |
|---|---|
| Next by Date: | RE:Installation error / was RE: Bug in JDBC Driver: Calling getBi gDecimal results in ConversionExceptionSapDB, Schroeder, Alexander |
| Previous by Thread: | error intalling package, James Wong |
| Next by Thread: | Re: Bug in JDBC Driver: Calling getBigDecimal results in ConversionExceptionSapDB, Thomas Rohwer |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |