首先,我们先看差别
然后,我们做一个demo。
开发环境:
OS:Windows
IDE: Eclipse IDE for Java Developers
1. sql
CREATE TABLE persons (
id int NOT NULL AUTO_INCREMENT ,
name varchar (50) ,
PRIMARY KEY (id))AUTO_INCREMENT=1;
2. java project
(1) Create new Java Project
(2) Add new folder “lib”
(3) Copy mysql-connector-java (jar) and myBatis to “lib” folder
(4)Add jars file to java build path
3. modify config.xml
In the "dataSource", the user name and password, into your own.
本文参考:
时间: 2024-10-12 10:21:28