zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

SpringBoot连接MySql数据库集成Mybatis详解编程语言

2023-06-13 09:20:43 时间
            artifactId spring-boot-starter-web /artifactId
                groupId org.springframework.boot /groupId
                artifactId spring-boot-maven-plugin /artifactId
                groupId org.apache.maven.plugins /groupId
                artifactId maven-assembly-plugin /artifactId
                        descriptorRef jar-with-dependencies /descriptorRef
                    ! MainClass in mainfest make a executable jar
                        mainClass com.lgp.SpringBoot.App /mainClass
        List Map String, Object list =  jdbcTemplate.queryForList(sql);
            Set Entry String, Object entries = map.entrySet( );
                    Iterator Entry String, Object iterator = entries.iterator( );
                    Entry String, Object entry =(Entry String, Object ) iterator.next( );
!DOCTYPE mapper PUBLIC -//mybatis.org//DTD Mapper 3.0//EN http://mybatis.org/dtd/mybatis-3-mapper.dtd
  select id= selectByPrimaryKey resultMap= BaseResultMap parameterType= java.lang.String
    values (#{id,jdbcType=VARCHAR}, #{message,jdbcType=VARCHAR}, #{senddate,jdbcType=TIMESTAMP}
  update id= updateByPrimaryKeySelective parameterType= com.lgp.SpringBoot.bean.AppMessage
  update id= updateByPrimaryKey parameterType= com.lgp.SpringBoot.bean.AppMessage
  select id= getMessById resultMap= BaseResultMap parameterType= java.lang.String
        List AppMessage list = service.getMessage();