The source code download from: https://how2j.cn/k/mybatis/mybatis-tutorial/1087.html#nowhere
Ask god to help look at what's situation,
& lt; ? The XML version="1.0" encoding="utf-8"?>
PUBLIC "-//mybatis.org//DTD Config/3.0/EN"
"Http://mybatis.org/dtd/mybatis-3-config.dtd" & gt;
Use Mybatis first connect to the database error: FATAL [main] main - getAssociatedStylesheets failed
The source code download from: https://how2j.cn/k/mybatis/mybatis-tutorial/1087.html#nowhere
Is a great god, please help to see what situation
CodePudding user response:
The Category. The content of the XML
<? The XML version="1.0" encoding="utf-8"?>
PUBLIC "-//mybatis.org//DTD Mapper/3.0/EN"
"Http://mybatis.org/dtd/mybatis-3-mapper.dtd" & gt;Select * from category_
CodePudding user response:
The content of the Category. Java
Package com. How2java;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
The import org. Apache. Ibatis. IO. Resources;
The import org. Apache. Ibatis. Session. SqlSession;
The import org. Apache. Ibatis. Session. SqlSessionFactory;
The import org. Apache. Ibatis. Session. The SqlSessionFactoryBuilder is;
The import com. How2java. Pojo. The Category;
Public class TestMybatis {
Public static void main (String [] args) throws IOException {
The String resource="mybatis - config. XML";
InputStream inputStream=Resources.getResourceAsStream(resource);
SqlSessionFactory sqlSessionFactory=new SqlSessionFactoryBuilder().build(inputStream);
SqlSession session.=sqlSessionFactory openSession ();
ListCs=session. SelectList (" listCategory ");
For (cs) Category c: {
Be sad etName chtistina georgina rossetti.british poetess System. Out. Println (());
}
}
}
CodePudding user response:
Post the complete error messageCodePudding user response: