让我们考虑,我们有人称一.人˚F是他的父亲,人中号是他的母亲,人乙是他的哥哥和人的小号是他的儿子.每个人可能有很多关系.这就是为什么,我们必须创建如下的新关系表:
人
+----+------+
| id | name |
+----+------+
| 1 | A |
| 2 | F |
| 3 | M |
| 4 | B |
| 5 | S |
+----+------+
Run Code Online (Sandbox Code Playgroud)
关系类型
+----+---------+
| id | value |
+----+---------+
| 1 | Father |
| 2 | Mother |
| 3 | Brother |
| 4 | Son |
| 5 | Wife |
| 6 …Run Code Online (Sandbox Code Playgroud) 在 Java spring boot 框架中,尝试使用以下方法消费 Store 过程
jdbcTemplate.setDataSource(dataSource);
SimpleJdbcCall simpleJdbcCall = new SimpleJdbcCall(jdbcTemplate)
.withSchemaName("abc")
.withFunctionName("proname")
.addDeclaredParameter(new
SqlOutParameter("",""));
Map<String, Object> map= new HashMap<>();
map.put("a",a);
map.put("b",b);
map.put("c",c);
map.put("d",d);
SqlParameterSource in = new MapSqlParameterSource(map);
Map<String, Object> out = simpleJdbcCall.execute(in);
Run Code Online (Sandbox Code Playgroud)
但我的程序也有参数这里是我的程序
function proname(z varchar2,
a varchar2,
b varchar2,
c varchar2,
d in out number,
e out number,
f out varchar2,
g out varchar2)
Run Code Online (Sandbox Code Playgroud)
该过程也有输出参数,如上面的代码所示,问题是如何在简单的 JDBC 调用中提到多个输出参数(注意多个)????
我尝试创建简单的用户登录和注册页面.但我无法使用服务方法创建用户.我有一个创建新用户的服务.
@Service
public class LocalUserDetailsService implements UserService {
//...
@Transactional
@Override
public User registerNewUserAccount(UserDto userDto) throws EmailExistsException {
System.out.println("registerNewUserAccount called");
if (emailExist(userDto.getEmail())) {
throw new EmailExistsException(
"There is an account with that email adress: "
+ userDto.getEmail());
}
return createUser(userDto);
}
private User createUser(UserDto userDto) {
User user = new User();
user.setEmail(userDto.getEmail());
user.setPassword(passwordEncoder.encode(userDto.getPassword()));
user.setEnabled(userDto.isEnabled());
Set<Role> roles = new LinkedHashSet<>();
userDto.getRoles().forEach((roleDto) -> {
roles.add(roleDao.getOrInsert(roleDto.getName()));
});
user.setRoles(roles);
return userDao.insert(user);
}
}
Run Code Online (Sandbox Code Playgroud)
我registerNewUserAccount(UserDto userDto)在2个地方叫方法.1)在启动时,我将此方法称为创建初始用户.
@Component
Run Code Online (Sandbox Code Playgroud)
公共类DatabaseFillerOnStartup实现ApplicationListener {
@Autowired
private UserService userService; …Run Code Online (Sandbox Code Playgroud) 我正在使用Delphi 2009,我想找到包含给定元素的HTML表索引.
因此,在我创建的应用程序中,我使用Web浏览器来查看网页.我想从这个页面中选择元素,并希望获得包含该元素的表的索引.
如果有人能做到,请帮助我
java ×2
spring-boot ×2
database ×1
delphi ×1
hibernate ×1
html ×1
spring ×1
spring-jdbc ×1
spring-mvc ×1
sql ×1
twebbrowser ×1