How to Update/Change user account name in H2 datab

2019-07-29 09:49发布

问题:

What query should be used to change the username of H2 database in embedded mode with JDBC? I need to update the username with the input string from the user.

回答1:

Use this query Note:The password will become invalid when the user name was changed

alter user "+username+" rename to "+newusername+"//alter username
alter user"+newusername+" set password '"+password+"' //alter password


标签: jdbc h2