title: Is there any way I can execute these queries with jpa?
body: <p>Is it possible to execute this query in jpa because the only options I see are <code>.getSingleResult();</code> or <code>.getResultList();</code> which both will throw exception since this query won't return any result.</p>
  
  <p>Is there any way I can execute these queries with jpa?</p>
  
  <p>And the reason I want to do it with jpa is because the <code>entityManager</code> already has the connection details and I don't want to create a special connection just for this query.</p>
  
  <pre><code>Query LoginkrijoQuery=em.createNativeQuery("USE MDAfondation ;"+
                                             "CREATE LOGIN "+username+" WITH password= '"+password+"',DEFAULT_DATABASE = MDAfondation,DEFAULT_LANGUAGE = english,CHECK_EXPIRATION = OFF ;");
  LoginkrijoQuery.getSingleResult();
  </code></pre>
  
  <p>well I tried it like this </p>
  
  <pre><code>em.getTransaction().begin();
      em.createNativeQuery("USE MDAfondation;\n "+
                           "CREATE LOGIN "+username+" WITH password= '"+password+"',DEFAULT_DATABASE = MDAfondation,DEFAULT_LANGUAGE = english,CHECK_EXPIRATION = OFF;\n"+
                           "USE MDAfondation;\n" +
                           "CREATE USER "+username+" FOR LOGIN "+username+";\n"+
                           "USE MDAfondation;\n" +
                           "sp_addrolemember 'stafi', '"+username+"';\n");
      em.getTransaction().commit();
  </code></pre>
  
  <p>Now it doesn't throw any exception but the query is never executed because when I check in SQL Server the <strong>login , user</strong>  never get created</p>