redshift jdbc driver not returning SQL line numbers in errors -


i'm building small sql client amazon redshift, , want display line number when there sql syntax/semantics error.

problem redshift's jdbc driver doesn't seem return position or line number (i'm using redshiftjdbc42-1.1.17.1017).

my code extracting syntax error message looks this:

try {     preparedstatement statement = conn.preparestatement(sql);     resultset rs = statement.executequery();     ... } catch(sqlexception ex) {     if(ex.getcause() instanceof errorexception) {         //redshift error         errorexception e = (errorexception)ex.getcause();         // no line numbers :(         //   e.getcolumnnumber() returns -1         //   e.getrownumber() returns -1         return e.getmessage();     }     return ex.getmessage(); } 

this returns messages like:

invalid operation: relation "user" not exist; 

but display:

invalid operation: relation "user" not exist; (line 9) 

any ideas/suggestions?


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -