This article is a personal note. The original database configuration file is written to death. Code: Mybatis configuration file beanid=ceclassorg. apache. commons. dbcp. basicperformancepropertynamedriverclassnamevaluecom. mysql. jdbc. Drivervaluepropertypropertynameu
This article is a personal note. The original database configuration file is written to death. Code: Mybatis configuration file bean id = dataSource class = org. apache. commons. dbcp. BasicDataSourceproperty name = driverClassNamevaluecom. mysql. jdbc. Driver/value/propertyproperty name = u
This article is a personal note.
The original database configuration file is written to death.
Code: Mybatis configuration file
Com. mysql. jdbc. Driver
Jdbc: mysql: // localhost: 3306/test
Root
Admin
The username and password here are all dead. Now I want a special configuration file to configure the database.
Baidu is easy.
Add the path of the data source configuration file and modify the database configuration.
WEB-INF \ config \ project. properties file:
database.ip =127.0.0.1database.port =3306database.userName =rootdatabase.passWord =admin
Change to driverClassName, url, username, and password. For personal project reasons, database port configuration is required in other places, so the url is spliced.
Note:
Here classpath: path refers to the WEB-INF/classes
Also designed. The difference between BasicDataSource DriverManagerDataSource is not ugly here.
Spring DriverManagerDataSource and apache BasicDataSource ()