4 Replies Latest reply on Nov 3, 2012 11:12 AM by Steven Hawkins

    User Impersonation and Teiid Parsing

    I Leitch Newbie

      We would like to "impersonate" users in a middleware layer. Using the jtds jdbc driver for SQL Server directly, this works as expected:


      String sql = "exec ('select remarks from TEST;') as user='ABC'";     

      try {

      x.directExecuteSql(sql, connection, true);



      Using the Teiid jdbc driver instead, we get a parsing error:


      sql = "exec ('select remarks from TEST;') as user='ABC'";

      try {

      x.directExecuteSql(sql,_conn, false);





      Nov 1, 2012 10:55:37 AM org.teiid.logging.JavaLogger log

      WARNING: TEIID30020 Processing exception 'TEIID31100 Parsing error: Encountered "(" at line 1, column 6.

      Was expecting:

          <ID> ...

          ' for request opLqyADiLoxc.0.  Exception type org.teiid.api.exception.query.QueryParserException thrown from org.teiid.query.parser.QueryParser.convertParserException(QueryParser.java:197). Enable more detailed logging to see the entire stacktrace.


      This is in embedded Teiid.


      Is there a better way to do this?