After runing wrong SQL Query, output always shows "Line 1, column 1" as error location.
Therefore debugging is difficult.
DB: PostgresSQL 8.4.2 (org.postgresql.Driver)
Product Version = NetBeans IDE 6.9 (Build 201006101454)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.6.0_20
Runtime = Java HotSpot(TM) Client VM 16.3-b01
Created attachment 101081 [details]
Created attachment 101082 [details]
For comparison: error message in pgAdmin of the same query.
It would be nice if the NB shows error information in similar way.
Any updates here?
I had a quick look at the problem. The information you need is only available in a database specific way and not accessible when only using standard jdbc.
To be more specific you'd have to extract the org.postgresql.util.ServerErrorMessage from the Exception and grab the Location via getPosition().
Without a hard dependency on the driver you could only use reflection to access the parameters. A good idea who to implement this is needed.
*** Bug 68585 has been marked as a duplicate of this bug. ***
*** Bug 155170 has been marked as a duplicate of this bug. ***
The implementation of this feature was fixed as:
the fix implements position extraction for the DBs PostgresSQL, Informix, Derby and H2. MySQL, MSSQL and Oracle were checked but did not provide enought information.
In the next few days a nightly build will be produced that contains the fix. By then a message will be posted here. Please check that nightly and if you find this fixed, please change status of this issue to VERIFIED. If not please specify what did not work.
Integrated into 'main-silver', will be available in build *201601190002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Matthias Blaesing <firstname.lastname@example.org>
Log: #189051: Extract error location from server reply on sql execution