Giter VIP home page Giter VIP logo

simplespringboot's Introduction

SimpleSpringBoot 程序

添加pom.xml。

编写启动代码,在浏览器中输入http://localhost:8081/即可看到Hello World!;此时即可证明springboot的程序已经启动,如果想更换端口请到src/main/resources/application.properties中修改。

添加相应的控制器后,在浏览器中输入http://localhost:8081/user/add可以在浏览器中看到add字符串

springboot集成Mybatis,在配置文件中配置数据库连接信息,创建表并添加数据

CREATE TABLE `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(60) COLLATE utf8_bin DEFAULT NULL,
  `age` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
INSERT INTO `user` VALUES ('1', 'king', '12');
INSERT INTO `user` VALUES ('2', 'flag', '45');

在浏览器中输入http://localhost:8081/user/queryall 当看到类似于

queryall:[User [id=1, name=king, age=12], User [id=2, name=flag, age=45]]

此时证明Mybatis集成成功,可以对数据库进行操作。

simplespringboot's People

Contributors

kingflag avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.