[ 
https://issues.apache.org/jira/browse/DBUTILS-117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16343676#comment-16343676
 ] 

Jozef Matejička commented on DBUTILS-117:
-----------------------------------------

Following code also triggers the error:
{code:java}
new QueryRunner().update(tenantDB, "execute as user = 'MY_USER'");{code}
 Driver:
{code:java}
 <dependency>
     <groupId>com.microsoft.sqlserver</groupId>
     <artifactId>mssql-jdbc</artifactId>
     <version>6.2.2.jre8</version>
 </dependency>{code}
Exception thrown:
{code:java}
com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the 
keyword 'as'.
SQLState = S0001
vendorCode = 156{code}

 Work around:
{code:java}
new QueryRunner(true).update(tenantDB, "execute as user = 'MY_USER'");{code}

> Error handling possible getParameterMetaData() results
> ------------------------------------------------------
>
>                 Key: DBUTILS-117
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-117
>             Project: Commons DbUtils
>          Issue Type: Bug
>    Affects Versions: 1.5
>            Reporter: Vadim Smirnov
>            Priority: Minor
>              Labels: easyfix, newbie
>             Fix For: 1.6
>
>         Attachments: DBUTILS-117-tests.patch, DBUTILS-117.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Error in fillStatement method of AbstractQueryRunner class.
> There is no try...catch statement near pmd = stmt.getParameterMetaData();
> So method fails instead of automaticallye turning pmdKnownBroken to true.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to