Code Monkey home page Code Monkey logo

sb-mysql-demo's Introduction

spring boot and mysql demo

deploying on ocp

oc new-project demo-app 

oc new-app mysql -e MYSQL_PASSWORD=Passw0rd_ -e MYSQL_USER=demouser -e MYSQL_DATABASE=demodb

oc new-build ubi8-openjdk-11:1.3~https://github.com/wohshon/sb-mysql-demo.git --name=demo-app 

oc new-app --image-stream=demo-app --env MYSQL_HOST=mysql

oc expose svc demo-app

testing

curl http://<your route>/rest/products/all

curl http://<your route>/rest/users/all


accessing the db

$ oc rsh <your mysql pod>
sh-4.4$ mysql -udemouser -pPassw0rd_ demodb
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 8.0.21 Source distribution

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select * from product;
+----+--------------+---------------------------------------+------------------+---------+------------+------------------------------+
| id | name         | description                           | img              | price   | product_id | short_desc                   |
+----+--------------+---------------------------------------+------------------+---------+------------+------------------------------+
|  1 | Mac Book Pro | Mac Book Pro 16 long description .... | img/mbp16.png    | 2500.99 | p0001      | Mac Book Pro 16 2020 Edition |
|  2 | Mac Book Pro | Mac Book Pro 13 long description .... | img/mbp13.png    | 1500.99 | p0002      | Mac Book Pro 13 2020 Edition |
|  3 | IPhone 12    | IPhone 12 long description ....       | img/iphone12.png |  700.99 | p0003      | IPhone 12 latest edition     |
|  4 | IPhone 11    | IPhone 11 long description ....       | img/iphone11.png |  690.99 | p0004      | IPhone 12 latest edition     |
+----+--------------+---------------------------------------+------------------+---------+------------+------------------------------+
4 rows in set (0.00 sec)


sb-mysql-demo's People

Contributors

wohshon avatar

Watchers

James Cloos avatar  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.