I have to run the following Oracle query using Spring Data JPA native queries.
create user "kshitij" identified by "qwert123"
I am trying this :
@Query(value="create user \"?1\" identified by \"qwert123\"",nativeQuery=true)
void createUser(String userName);
However when I wrap ?1 by "" then it Hibernate stops treating ?1 as variable to be substituted by userName, instead as actual string. How would I accomplish running the above mentioned Oracle query in spring data jpa?
Alongwith create I would also like to check if user exists.
Current not working approach :
@Query(value="select username from all_users where username = \"?1\"", nativeQuery=true)