This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 257404 - com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting the nvarchar value 'M11760' to data type int.
Summary: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when conve...
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: matthias42
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-05 01:44 UTC by Exceptions Reporter
Modified: 2016-02-11 21:18 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 177060


Attachments
stacktrace (1.12 KB, text/plain)
2016-01-05 01:44 UTC, Exceptions Reporter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2016-01-05 01:44:19 UTC
Build: NetBeans IDE 8.0.2 (Build 201411181905)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.66-b17, Java(TM) SE Runtime Environment, 1.8.0_66-b17
OS: Linux

User Comments:
athompson: Trying to run a SQL query.

GUEST: this problem appears when comparing an nvarchar column and 'M11760'.

athompson: This should not trigger a Netbeans bug report, since the problem is with the database.

GUEST: 1) I executed a select query on table with a varchar field, e.g '20140430', that  corresponds to a date with format 'YYYYMMDD'.
2) the select query was like 'select varchar_date from ...'. I executed the query and everything was ok.
2) When I clicked on 'next page' on the result tab, the error was triggered.

GUEST: MSSQL Query




Stacktrace: 
com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting the nvarchar value 'M11760' to data type int.
   at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
   at com.microsoft.sqlserver.jdbc.SQLServerResultSet$FetchBuffer.nextRow(SQLServerResultSet.java:4853)
   at com.microsoft.sqlserver.jdbc.SQLServerResultSet.fetchBufferNext(SQLServerResultSet.java:1781)
   at com.microsoft.sqlserver.jdbc.SQLServerResultSet.next(SQLServerResultSet.java:1034)
   at org.netbeans.modules.db.dataview.output.SQLExecutionHelper.loadDataFrom(SQLExecutionHelper.java:746)
   at org.netbeans.modules.db.dataview.output.SQLExecutionHelper.access$800(SQLExecutionHelper.java:84)
Comment 1 Exceptions Reporter 2016-01-05 01:44:22 UTC
Created attachment 158002 [details]
stacktrace
Comment 2 matthias42 2016-02-11 21:18:34 UTC
This indeed looks a DB level problem and I agree with athompson that this is not a netbeans bug and should not lead to exception reports.

The fix was already commited as part of the fix for bug #257457 or more precicesely the fallout from that.

See this commit for the change:

http://hg.netbeans.org/core-main/rev/6edbf343df7a#l3.23

Level.SEVERE leads to the exception report.

If there is someone being able to reproduce this issue, please test with a recent nightly and see if you can VERIFY the fix. Thank you.