schema

【Spring MVC】创建web工程步骤

北城余情 提交于 2020-01-15 08:51:33
1.new project->maven 2.add dependencies pom.xml < dependencies > <!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc --> < dependency > < groupId > org.springframework </ groupId > < artifactId > spring-webmvc </ artifactId > < version > 5.2.1.RELEASE </ version > </ dependency > </ dependencies > 3.添加web模块 4. com.bailiban.controller.HelloController @RestController public class HelloController { @RequestMapping ( { "/" , "" , "/hello" } ) public String hello ( ) { return "Hello World!" ; } } dispatcher-servlet.xml < ? xml version = "1.0" encoding = "UTF-8" ? > < beans

Spring 事务处理

点点圈 提交于 2020-01-15 00:49:13
前言: 事务处理的本质 在学习事务处理前,需要明确一点: 数据库操作最终都要使用到JDBC,那么无论上层如何封装,底层都是调用Connection的commit,rollback来完成 烦人的事务处理: 在日常开发中,数据访问层(DAO)必然需要进行事务的处理,但是我们会发现,事务处理的代码通常是简单的重复的,编写这样的重复代码会浪费大量的时间,所以我们需要找到一种方案可以将这些重复的代码进行抽取,以便与管理维护和复用, 我们的需求:在一系列数据库操作上的方法上增加额外的事务处理代码,让原来的方法中只关注具体的数据处理,即在原本以及存在的数据库操作方法上添加额外的事务处理逻辑 到这里你应该想到AOP了,没错! 这样的场景下AOP是最好的解决方案; 解决方案:AOP 回顾一下Spring的AOP:在结合目前的需求 1.将目标对象(DAO)放入Spring容器 2.告知Spring你的通知代码是什么(事务处理) 3.告知Spring 哪些方法(DAO的CRUD)要应用那些通知(不同的事务处理代码) 4.从Spring中获取代理对象来完成原本的CRUD,代理对象会自动完成事务处理 Spring 事务处理API Spring作为框架,需要进行详细的设计,全方位的考虑事务处理的各个方面,而不仅是简单的帮你执行commit,rollback; Spring对事务处理进行了抽象定义

Spark DataFrame、Spark SQL、Spark Streaming入门教程

五迷三道 提交于 2020-01-14 23:06:47
文章目录 前言 1、RDD、Spark DataFrame、Spark SQL、Spark Streaming 2、Spark DataFrame 2.1 创建基本的Spark DataFrame 2.2 从各类数据源创建Spark DataFrame 2.3 Spark DataFrame持久化数据 2.4 Dataframe常见的API 3、Spark SQL 4、Spark Streaming 实时计算TCP端口的数据 前言   本文介绍Spark DataFrame、Spark SQL、Spark Streaming入门使用教程,这些内容将为后面几篇进阶的streaming实时计算的项目提供基本计算指引,本文绝大部分内容来自Spark官网文档(基于PySpark): Spark DataFrame 、 Spark SQL 、 Spark Streaming 1、RDD、Spark DataFrame、Spark SQL、Spark Streaming   RDD:大家最熟悉的数据结构,主要使用transmissions和actions 相关函数式算子完成数据处理和数理统计,例如map、reduceByKey,rdd没有定义 Schema(一般指未定义字段名及其数据类型), 所以一般用列表索引号来指定每一个字段。 例如, 在电影数据的推荐例子中: move_rdd.map

Use <xs:all> in XML schema's complexType?

我是研究僧i 提交于 2020-01-14 22:42:48
问题 I have the following XML complexType s defined: <xs:complexType name="loss"> <xs:all> <xs:element name="lossCause" type="xs:string"/> <xs:element name="lossDate" type="xs:dateTime"/> <xs:element name="lossDescription" type="xs:string"/> <xs:element name="lossLocation" type="address" minOccurs="0"/> <xs:element name="lossTime" type="xs:string" minOccurs="0"/> <xs:element name="officials" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element name="official" type="official" minOccurs="0"

SpringMVC的入门例子

谁说我不能喝 提交于 2020-01-14 13:39:35
MVC框架是什么 模型-视图-控制器(MVC)是一个众所周知的以设计界面应用程序为基础的设计模式。它主要通过分离模型、视图及控制器在应用程序中的角色将业务逻辑从界面中解耦。通常,模型负责封装应用程序数据在视图层展示。视图仅仅只是展示这些数据,不包含任何业务逻辑。控制器负责接收来自用户的请求,并调用后台服务(manager或者dao)来处理业务逻辑。处理后,后台业务层可能会返回了一些数据在视图层展示。控制器收集这些数据及准备模型在视图层展示。MVC模式的核心思想是将业务逻辑从界面中分离出来,允许它们单独改变而不会相互影响。 在Spring MVC应用程序中,模型通常由POJO对象组成,它在业务层中被处理,在持久层中被持久化。视图通常是用JSP标准标签库(JSTL)编写的JSP模板。控制器部分是由dispatcher servlet负责,在本教程中我们将会了解更多它的相关细节。 一些开发人员认为业务层和DAO层类是MVC模型组件的一部分。我对此持有不同的意见。我不认为业务层及DAO层类为MVC框架的一部分。通常一个web应用是3层架构,即数据-业务-表示。MVC实际上是表示层的一部分。 Dispatcher Servlet(Spring控制器) 在最简单的Spring MVC应用程序中,控制器是唯一的你需要在Java web部署描述文件(即web.xml文件)中配置的Servlet

Swagger Yaml schema definition for object without a fixed property list

…衆ロ難τιáo~ 提交于 2020-01-14 13:33:31
问题 I am implementing an API-first application with the help of Swagger. One of the most important objects to be returned is a DICOM object, which returns a collection of attributes with flexible names, for example: { "00080005": {"vr":"CS","Value":["ISO_IR 100"]}, "00080020": {"vr":"DA","Value":["20160602"]}, "00080030": {"vr":"TM","Value":["171855.7490"]}, "00080050": {"vr":"SH","Value":["1234"]}, "00080090": {"vr":"PN","Value":[{"Alphabetic":"Parikh MD^Anush^M"}]} } So I cannot know the name

A database schema for Tags (eg. each Post has some optional tags)

ぐ巨炮叔叔 提交于 2020-01-14 08:06:06
问题 I have a site like SO, Wordpress, etc, where you make a post and u can have (optional) tags against it. What is a common database schema to handle this? I'm assuming it's a many<->many structure, with three tables. Anyone have any ideas? 回答1: A three table many to many structure should be fine. Eg. Posts, PostsToTags(post_id,tag_id), Tags The key is indexing. Make sure you PostsToTags table is indexed both ways ( post_id,tag_id and tag_id,post_id ) also if read performance is ultra critical

How to see the schema of a db2 table (file)

强颜欢笑 提交于 2020-01-14 07:47:08
问题 As in subject... is there a way of looking at an empty table schema without inserting any rows and issuing a SELECT? 回答1: Are you looking for DESCRIBE? db2 describe table user1.department Table: USER1.DEPARTMENT Column Type Type name schema name Length Scale Nulls ------------------ ----------- ------------------ -------- -------- -------- AREA SYSIBM SMALLINT 2 0 No DEPT SYSIBM CHARACTER 3 0 No DEPTNAME SYSIBM CHARACTER 20 0 Yes 回答2: SELECT * FROM SYSIBM.SYSCOLUMNS WHERE TBNAME = 'tablename'

How to store birthdays without a year part?

拜拜、爱过 提交于 2020-01-14 07:45:08
问题 Similar question: Postgres birthdays selection We're designing a new feature: we'll be storing the month and day parts of people's birthdays, but not the year. So a user born on christmas will have the birthday "12/25". The question is, how can we best represent this in postgres? The date column requires a year, and also rejects leapdays in non-leapyears. We could store all birthdays with an arbitrary leap year, e.g. '1972-12-25' , but that'd be a bit of a kludge. We could use two int columns

RocketMQ

◇◆丶佛笑我妖孽 提交于 2020-01-14 03:38:38
http://rocketmq.apache.org/docs/quick-start/ 解压后添加启动脚本 nohup sh bin/mqnamesrv >> logs/namesrv.log 2>&1 & nohup sh bin/mqbroker -n localhost:9876 >> logs/broker.log 2>&1 & 启动broker的时候可能会报错 修改bin/runbroker.sh里面的JVM配置 JAVA_OPT="${JAVA_OPT} -server -Xms2g -Xmx2g -Xmn1g" 监控界面: https://github.com/apache/rocketmq-externals/tree/master/rocketmq-console 参考文章: https://www.cnblogs.com/cac2020/p/9447938.html 按文中部署后运行程序还报错: 直接在/etc/hosts中添加 127.0.0.1 dev-server02 再次运行即可 集群部署 使用2台机器,用2m-noslave 模式 2台机器IP为: 172.20.102.194 mq2 172.20.102.150 mq1 在两台机器的/etc/hosts中添加上面的配置 在mq1机器上配置 conf/2m-noslave/broker-a