随笔分类 - 数据库
摘要:spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver password: xxxx username: root url: jdbc:mysql://www.xxxxxx.cn:3306/thisDemo?allowMulti
阅读全文
摘要:在Java开发中,VO、BO、PO、DO和DTO都是常见的对象命名规范,这些规范用于定义不同用途的类和对象。 VO(Value Object): 值对象,通常用于表示界面或外部系统交互时的数据模型,主要用于展示视图数据,VO中的属性一般为只读。 BO(Business Object):业务对象,用于
阅读全文
摘要:1、spring中@Param ( import org.springframework.data.repository.query.Param; ) int selectRoleCount(@Param("businessId") Integer businessId,@Param("member
阅读全文
摘要:完整的报错是: ERROR com.alibaba.druid.pool.DruidDataSource - create connection SQLException, url: jdbc:mysql:/xxxxx/xxxxx, errorCode 0, state 01S00 java.sql
阅读全文
摘要:可以在mybatis-config.xml配置文件中,通过settings标签进行设置 配置文件代码: <settings> <!--开启驼峰匹配--> <setting name="mapUnderscoreToCamelCase" value="true"/> </settings>
阅读全文
摘要:做个笔记 row_number() over(partition by 分组列 order by 排序列 desc) SELECT * FROM (SELECT T.*, ROW_NUMBER() OVER(PARTITION BY T.deviceid ORDER BY T.itime DESC)
阅读全文
摘要:今天尝试用idea连接MySQL数据库,测试连接时报错 Server returns invalid timezone. Go to ‘Advanced’ tab and set ‘serverTimezone’ property manually. 根据字面意思是时区方面的错误,百度后在url后加
阅读全文
摘要:select to_char(Sysdate,'yyyy-mm-dd HH24:MI:SS') from dual; --当前时间 select to_char(Sysdate+1,'yyyy-mm-dd HH24:MI:SS') from dual --当前时间加1天 select to_char
阅读全文
摘要:一. 查询给定时间在开始时间列与结束时间列范围中数据; select * from t 表名 where t.日期列 >= to_date('20xx-xx-xx 00:00:00','yyyy-mm-dd hh24:mi:ss') and t.日期列 <= to_date('20xx-xx-xx
阅读全文