IntelliJ Idea使用笔记2.mapper文件提示:No data sources are configured to run this sq警告

用idea时。mapper.xml文件出现警告

No data sources are configured to run this SQL and provide advanced code assistance. Disable this inspection via problem menu (Alt+Enter). more… (Ctrl+F1)

SQL dialect is not configured. PostgreSQL, SQL Server match best. more… (Ctrl+F1) 

这是两个警告,首先我们解决一个警告

1.使用idea连接数据库

如果找不到右侧的工具栏,请点击File–>setting–>appearance 

è¿éåå¾çæè¿°

è¿éåå¾çæè¿°

2è¿éåå¾çæè¿°

è¿éåå¾çæè¿°

连接了数据库之后,mapper文件的背景色变成了浅绿色,并且编写sql的时候会有代码提示和错误提示,非常方便 

2.解决另一个警告

File -> setting 搜索inspections,再搜索sql,找到SQL dialect detection去掉勾,然后apply ->ok 

è¿éåå¾çæè¿°

大功告成

猜你喜欢

转载自blog.csdn.net/qq_23337175/article/details/82150595