热门 传统jdbc写法
package pw.goyd.db;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import pw.goyd.game.constant.se...
package pw.goyd.db;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import pw.goyd.game.constant.se...
传统dao开发也可以
这种方法是使用Mapper代理操作
AccountMapper accountMapper = Server.sessionFactory.openSession()
.getMapper(AccountMapper.class);
Account account = accountMapper.getAccount(acc);...
首先配置允许访问的用户,采用授权的方式给用户权限
1 | GRANT ALL PRIVILEGES ON *.* TO 'root' @ '%' IDENTIFIED BY '123456' WITH GRANT OPTION ; |
&nbs...