zoukankan      html  css  js  c++  java
  • [数据治理]

    入职公司后,被分配做数据治理平台的自研工作。主要是负责数据治理平台的后台开发工作。

    这篇博文主要记录一下学习到的SpringBoot知识:

    java基础:

    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.util.regex.Pattern;

    测试数据库连接:Connection conn= DriverManager.getConnection("jdbc:mysql://172.22.198.35:3306/saas_data_center","gaia_bi","gaia_bi");

    判断字符串是否是正整数:boolean pattern = Pattern.compile("^[1-9]\d*$").matcher(str).matches();

    Web开发:

    接收get请求:

    1. 方法参数名即为请求参数名
    @RequestMapping(value = "/test/query1", method = RequestMethod.GET) public String testQuery1(String username, String password) {
    2.用实体类来接收,Spring会自动将参数值绑定到对应的实体类的属性上
    @RequestMapping(value = "/test/query4", method = RequestMethod.GET) public String testQuery4(User user) {

    接收post请求:

     @RequestMapping(value = "/test/form1", method = RequestMethod.POST)
      public String testForm1(String username, String password) {

    @RequestMapping(value = "/test/form4", method = RequestMethod.POST)
      public String testForm4(User user) {

    1.接收post请求,并且请求参数在Body体中,并且为json格式:
    @RequestMapping(value = "/test/json1", method = RequestMethod.POST)
      public String testJson1(@RequestBody User user) {
    注意:这种情况下,如果实体类的属性中套了其他实体类(比如private List<Student> User;),Student实体类不能是内部类 或 ?。

    参数在请求路径上:

    @RequestMapping(value = "/test/url/{username}/{password}", method = RequestMethod.GET)
      public String testUrl(@PathVariable String username, @PathVariable String password) {

    MyBaits:

    创建表:<sql id="createTable">${sql_String}</sql>或用<update id="createTable">${sql_String}</update>

    官方网站:https://mybatis.org/mybatis-3/zh/sqlmap-xml.html#insert_update_and_delete  mybaits


    参考博文:https://www.cnblogs.com/lasdaybg/p/9849883.html 作者:lasdaybg
     
     
     
     
     
     
  • 相关阅读:
    找出优先要作的工作
    我要作技术研发了
    确定配色方案
    今天公司搬家
    要作界面原型了
    使用自已的命名空间
    进行审核了
    那里有皮肤软件工开发包的源码???
    发葡萄
    作业务规则挺难
  • 原文地址:https://www.cnblogs.com/lintong-zf/p/14303762.html
Copyright © 2011-2022 走看看