目前所需依赖大全(慢慢的加了)

1 mybatis/mysql:

如果在dao要使用别名,mybatis就用2.1.0版本

            <dependency>
                <groupId>org.mybatis.spring.boot</groupId>
                <artifactId>mybatis-spring-boot-starter</artifactId>
                <version>2.1.0</version>
            </dependency>
             <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>5.1.47</version>
            </dependency>

properties设置:

#配置jdbc
#start druid
spring.datasource.druid.enable=true
#云服务器:spring.datasource.url=jdbc:mysql://cdb-16f3cr8u.cd.tencentcdb.com:10196/demo?#serverTimezone=Asia/Shanghai&characterEncoding=utf8

spring.datasource.url=jdbc:mysql:///qq?serverTimezone=Asia/Shanghai&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#/配置jdbc
#其它配置
#mapper映射文件的位置
mybatis.mapper-locations=classpath:/mapper/*.xml,/mapper/*/*.xml
#logging
logging.level.com.org.main.dao=debug
#允许传输隐藏字段
spring.mvc.hiddenmethod.filter.enabled=true
#将数据库下划线转小驼峰
mybatis.configuration.map-underscore-to-camel-case=true
#日志配置
logging.level.com.xhs.main.dao=trace  

mapper文件书写:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.woniu.Useroperation.Dao.UserInfoDao">

    <insert id="addUser">
        insert into userInfo values (#{id},#{uid},#{account}, #{psw},
        #{uname},#{sex},#{email},#{userPhoto},#{birth},#{sign},#{status},#{createTime},#{gold})
    </insert>

    <select id="select_register_userName_and_email" resultType="com.woniuxy.springcloud.entity.UserInfo">
        SELECT * FROM userInfo where 1=1
        <if test="thisAccount!=null and thisAccount!=''">
            and account =#{thisAccount}
        </if>
        <if test="thisEmail!=null and thisEmail!=''">
            and email =#{thisEmail}
        </if>
    </select>
    <update id="update_users_message">
        update userInfo set
        <if test="account!=null and account!=''">
            account=#{account},
        </if>
        <if test="password!=null and password!=''">
            psw=#{password},
        </if>
        <if test="uname!=null and uname!=''">
            uname=#{uname},
        </if>
        <if test="thisEmail!=null and thisEmail!=''">
            email=#{thisEmail},
        </if>
        <if test="userPhoto!=null and userPhoto!=''">
            user_photo=#{userPhoto},
        </if>
        <if test="sign!=null and sign!=''">
            sign=#{sign},
        </if>
        <if test="gold!=null and gold!=''">
            gold=#{gold},
        </if>
        id=id where userId=#{userId}
    </update>

</mapper>

2  oracle

连接到oracle数据库:

database.url=jdbc\:oracle\:thin\:@localhost\:1521\:ORCL //本地数据库

#database.url=jdbc\:oracle\:thin\:@ip地址\:1521\:ORCL //别人的数据库


database.driver=oracle.jdbc.driver.OracleDriver //通用配置

database.user=abzjcy //oracle 用户名

database.password=123456 //密码

oracle 导入dmp文件

先新建表空间(因为是习惯用navicat的原因我选择是在navicat中创建的表空间)

创建一个用户

在plsql进行导入

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值