av一区二区在线观看_亚洲男人的天堂网站_日韩亚洲视频_在线成人免费_欧美日韩精品免费观看视频_久草视

您的位置:首頁技術文章
文章詳情頁

IDEA 格式化SQL代碼技巧分享

瀏覽:4日期:2024-07-24 08:26:59
寫在前面

IntelliJ IDEA集成了很多我們開發(fā)中常用的工具,Linux連接,Git,數(shù)據(jù)庫操作…

這里我們介紹,IDEA集成數(shù)據(jù)庫操作,并對SQL可格式化…

通過命令,但是在合適的執(zhí)行文件中…

Ctrl Alt L

1.1、建立連接,數(shù)據(jù)庫服務器地址,賬號,密碼等…

IDEA 格式化SQL代碼技巧分享

1.2、基本操作,很多,增刪改查,控制臺SQl編寫等等

IDEA 格式化SQL代碼技巧分享

SQL執(zhí)行控制臺,這里是格式化之后的,我們平時手寫的SQL都是沒有格式化的,注意這里提供了輸入框,操作占位符的參數(shù)也很方便…

IDEA 格式化SQL代碼技巧分享

那么這里的格式化的SQL是怎么實現(xiàn)的呢??

這里的哈,IDEA的快捷鍵 Ctrl + Alt + L,就可以格式化SQL

IDEA 格式化SQL代碼技巧分享

補充:解決idea的src目錄下不能編譯SQL語句的xml配置文件的問題

一:正常配置下的情況

1.編譯的目錄下不會編譯映射配置文件.xml,但是resources目錄中的文件都被編譯出來。

IDEA 格式化SQL代碼技巧分享

2.pom.xml文件的配置

<?xml version='1.0' encoding='UTF-8'?> <project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd'> <modelVersion>4.0.0</modelVersion> <groupId>com.sly</groupId> <artifactId>hrm01</artifactId> <version>1.0-SNAPSHOT</version> <packaging>war</packaging> <name>hrm01 Maven Webapp</name> <!-- FIXME change it to the project’s website --> <url>http://www.example.com</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> <!-- 導入jar包 1.spring的jar包:11個 com.springsource.org.aopalliance-1.0.0.jar com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar spring-aop-5.0.1.RELEASE.jar spring-aspects-5.0.1.RELEASE.jar spring-beans-5.0.1.RELEASE.jar spring-context-5.0.1.RELEASE.jar spring-core-5.0.1.RELEASE.jar spring-expression-5.0.1.RELEASE.jar spring-jcl-5.0.1.RELEASE.jar spring-jdbc-5.0.1.RELEASE.jar spring-tx-5.0.1.RELEASE.jar --> <!-- https://mvnrepository.com/artifact/org.aopalliance/com.springsource.org.aopalliance --> <dependency> <groupId>org.aopalliance</groupId> <artifactId>com.springsource.org.aopalliance</artifactId> <version>1.0.0</version> </dependency> <!-- https://mvnrepository.com/artifact/org.aspectj/com.springsource.org.aspectj.weaver --> <dependency> <groupId>org.aspectj</groupId> <artifactId>com.springsource.org.aspectj.weaver</artifactId> <version>1.6.4.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-aop --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>5.0.10.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>5.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>5.0.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>5.0.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>5.0.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>5.0.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jcl</artifactId> <version>5.0.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>5.0.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>5.0.1.RELEASE</version> </dependency> <!--導入jar包 2.springmvc的jar包:2個 spring-web-5.0.1.RELEASE.jar spring-webmvc-5.0.1.RELEASE.jar 3.MyBatis的jar包:13個 mybatis-3.4.2.jar 依賴jar包12個 4.MyBatis和Spring整合的jar包:1個 mybatis-spring-1.3.1.jar --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>5.0.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>5.0.1.RELEASE</version> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.4.2</version> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>1.3.1</version> </dependency> <!--導入jar包5.數(shù)據(jù)庫驅動jar包:1個mysql-connector-java-5.1.7-bin.jar6.數(shù)據(jù)源druid的jar包:1個druid-1.1.5.jar7.JSTL的jar包:2個jstl-1.1.2 .jarstandard-1.1.2.jar--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.48</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.5</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>1.1.2</version> </dependency> <!--導入Tomcat的jar包--> <!-- https://mvnrepository.com/artifact/org.apache.tomcat/tomcat-servlet-api --> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat-servlet-api</artifactId> <version>9.0.21</version> </dependency> </dependencies> <build> <finalName>hrm01</finalName> <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> <plugins> <plugin> <artifactId>maven-clean-plugin</artifactId> <version>3.1.0</version> </plugin> <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging --> <plugin> <artifactId>maven-resources-plugin</artifactId> <version>3.0.2</version> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.1</version> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>3.2.2</version> </plugin> <plugin> <artifactId>maven-install-plugin</artifactId> <version>2.5.2</version> </plugin> <plugin> <artifactId>maven-deploy-plugin</artifactId> <version>2.8.2</version> </plugin> </plugins> </pluginManagement> </build></project>

3.控制臺無報錯且網(wǎng)頁報錯404 找不到,或者500如下錯誤。

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ’userHandler’: Unsatisfied dependency expressed through field ’userService’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ’userServiceImpl’: Unsatisfied dependency expressed through field ’userDao’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ’IUserDao’ defined in file [D:Tomcatapache-tomcat-9.0.27webappshrm01_warWEB-INFclassescomhrmuserdaoIUserDao.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Wrong namespace. Expected ’com.hrm.user.dao.IUserDao’ but found ’com.hrm.user.dao.UserDao’.

IDEA 格式化SQL代碼技巧分享

二、解決方案

1.在pom文件中的build標簽下配置該屬性即可解決這個問題,但是要注意src前面不要加 / 。

一定不要寫為:(/src/main/java)。

這樣在編譯目錄下xml文件也被編譯。

IDEA 格式化SQL代碼技巧分享

2.加入該配置后編譯目錄下有了映射配置文件,見上圖IUserDao.xml。

控制臺可以正常顯示數(shù)據(jù)。

以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持好吧啦網(wǎng)。如有錯誤或未考慮完全的地方,望不吝賜教。

標簽: IDEA
相關文章:
主站蜘蛛池模板: 九九色综合 | 一级毛片在线播放 | 天天干.com | 亚洲不卡在线观看 | 亚洲精品一区二区三区四区高清 | 秋霞精品 | 男女午夜免费视频 | 国产一区91精品张津瑜 | 久久精品女人天堂av | 超碰激情 | 91亚洲国产成人久久精品网站 | 久久天堂网| 欧美精品乱码久久久久久按摩 | 成人伊人 | 欧美久久久久久久 | 亚洲日本中文字幕在线 | 日日噜噜噜夜夜爽爽狠狠视频97 | 日韩中文字幕在线播放 | 婷婷激情综合 | 国产精品久久久久久久久久软件 | 黄 色 毛片免费 | 欧洲精品在线观看 | 黄色在线播放视频 | 日本又色又爽又黄的大片 | 欧美一区二区在线观看视频 | 91精品国产91久久久久久吃药 | 国产精品高清一区二区三区 | 亚洲 欧美 在线 一区 | 欧美日韩中文字幕在线 | 国产综合一区二区 | 久久久av中文字幕 | 天堂中文av| 黄色一级免费看 | 国产精品久久在线观看 | 免费在线h视频 | 成人免费视频一区 | 日韩成人在线看 | 久草在线视频中文 | 亚洲一区二区三区乱码aⅴ 四虎在线视频 | 久色视频在线观看 | 成人av一区二区亚洲精 |