@PreLoadClass(value=-2147483647) @Configuration public class InitDb extends Object implements org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean
Constructor and Description |
---|
InitDb() |
Modifier and Type | Method and Description |
---|---|
static void |
addBeforeCallback(Runnable consumer) |
static void |
addCallback(Supplier<Boolean> supplier)
添加监听回调
|
void |
afterPropertiesSet() |
void |
alterUser(String oldUes,
String newUse,
String newPwd)
修改账号 密码
|
void |
destroy() |
public static void addBeforeCallback(Runnable consumer)
public static void addCallback(Supplier<Boolean> supplier)
supplier
- 回调,返回 true 需要重新初始化数据库public void alterUser(String oldUes, String newUse, String newPwd) throws SQLException
oldUes
- 旧的账号newUse
- 新的账号newPwd
- 新密码SQLException
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
Copyright © 2017–2022. All rights reserved.