Package org.h2.command.ddl
Class CreateUser
java.lang.Object
org.h2.command.Prepared
org.h2.command.ddl.DefineCommand
org.h2.command.ddl.CreateUser
This class represents the statement
CREATE USER
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private String
private Expression
private boolean
private Expression
private Expression
private String
Fields inherited from class org.h2.command.ddl.DefineCommand
transactional
Fields inherited from class org.h2.command.Prepared
create, parameters, prepareAlways, session, sqlStatement, sqlTokens
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static byte[]
getByteArray
(SessionLocal session, Expression e) int
getType()
Get the command type as defined in CommandInterfacevoid
setAdmin
(boolean b) void
setComment
(String comment) void
void
setIfNotExists
(boolean ifNotExists) (package private) static void
setPassword
(User user, SessionLocal session, Expression password) Set the password for the given user.void
setPassword
(Expression password) void
(package private) static void
setSaltAndHash
(User user, SessionLocal session, Expression salt, Expression hash) Set the salt and hash for the given user.void
setUserName
(String userName) long
update()
Execute the statement.Methods inherited from class org.h2.command.ddl.DefineCommand
isReadOnly, isTransactional, queryMeta, setTransactional
Methods inherited from class org.h2.command.Prepared
checkCanceled, checkParameters, collectDependencies, getCteCleanups, getCurrentRowNumber, getObjectId, getParameters, getPersistedObjectId, getPlanSQL, getSession, getSimpleSQL, getSQL, getSQLTokens, isCacheable, isQuery, needRecompile, prepare, query, setCommand, setCteCleanups, setCurrentRowNumber, setParameterList, setPersistedObjectId, setPrepareAlways, setRow, setSession, setSQL, toString
-
Field Details
-
userName
-
admin
private boolean admin -
password
-
salt
-
hash
-
ifNotExists
private boolean ifNotExists -
comment
-
-
Constructor Details
-
CreateUser
-
-
Method Details
-
setIfNotExists
public void setIfNotExists(boolean ifNotExists) -
setUserName
-
setPassword
-
setSaltAndHash
Set the salt and hash for the given user.- Parameters:
user
- the usersession
- the sessionsalt
- the salthash
- the hash
-
getByteArray
-
setPassword
Set the password for the given user.- Parameters:
user
- the usersession
- the sessionpassword
- the password
-
update
public long update()Description copied from class:Prepared
Execute the statement. -
setSalt
-
setHash
-
setAdmin
public void setAdmin(boolean b) -
setComment
-
getType
public int getType()Description copied from class:Prepared
Get the command type as defined in CommandInterface
-