mybatis-config.xml:
applications.properties:
jdbc.driverClassName=com.mysql.cj.jdbc.Driverjdbc.url=jdbc:mysql://localhost:3306/online_judge?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8&useSSL=truejdbc.username=rootjdbc.password=woaimysql-135
context.xml(JNDI配置数据源):
UserMapper.xml:
INSERT INTO online_judge.users (email, password, name, sex, role, enabled) VALUES (#{email}, #{password}, #{name}, #{sex}, #{role}, #{enabled}) UPDATE online_judge.users SET email = #{email}, password = #{password}, name = #{name}, sex = #{sex}, role = #{role}, enabled = #{enabled} WHERE id = #{id} DELETE FROM online_judge.users WHERE id = #{id}