要修改MyBatis和Druid中的表名,可以通过以下步骤进行:
<select id="selectUserById" resultType="User"> SELECT * FROM new_table WHERE id = #{id} </select>
@Table(name = "new_table") public class User { // 实体属性 }
spring.datasource.url=jdbc:mysql://localhost:3306/new_database spring.datasource.username=root spring.datasource.password=password
通过以上步骤,就可以成功修改MyBatis和Druid中的表名。