【发布时间】:2017-01-17 10:38:58
【问题描述】:
当我尝试使用 myBatis、SQL 连接器和 Maven 运行项目时,我需要帮助我的项目,但我得到了这个错误:
"no suitable jdbc driver found"
从现在开始,我不知道如何解决这个问题。
public void openConnection() throws IOException, SQLException {
///database/src/main/java/Mappers/
String resource = "mybatis-config.xml";
InputStream inputStream = Resources.getResourceAsStream(resource);
SqlSessionFactory sqlSessionFactory =
new SqlSessionFactoryBuilder().build(inputStream);
session = sqlSessionFactory.openSession();
updateData();
}
private void updateData() {
int createTable = session.update("database.resources.createTableToTest");
int addTable = session.update("database.resources.addToTest");
test();
}
【问题讨论】:
标签: java maven jdbc mybatis ibatis