mysql and tomcat - university of california, irvineminhaenl/class/android_class/8. db_was.pdf ·...
TRANSCRIPT
System Overview
MySQLDatabase
APP
WebServerTomcat
Models
SQL forTable Creation
During development time
During both developmentAnd service time
During both developmentAnd service time
Java+SQL
HTTP
e.g.) http://mydomain.com/createUser.iedu/?name=jason&[email protected]
Export SQL for table creation
Next without any change Next without any change Copy all query (Ctrl+a, Ctrl+c)
Query Test
• select * from user;
• insert into user values (null, 'jason', '[email protected]', '12345');
• insert into user values (null, 'park', '[email protected]', '12345');
• insert into user values (null, 'park', '[email protected]', '12345');
• select * from user;
• update user set name='mike' where id = 1;
• select * from user;
• delete from user where id>0
URL Example : http://<domain>:<port>/<path>/<servletPath>
Your URL
http://<domain>:<port>/<path>/<servletPath>
127.0.0.1 : userself (localserver)54.201.57.109 (ex. AWS)
URL ExampleIn edu/iedu/flashcard/dao/web/UserController.jara
Servlet Path
Index.jsp
Suffix is defined in “WebTemplate\WebContent\WEB-INF\SpringEx-servlet.xml”
URL Example
http://127.0.0.1:8080/IEDU_Flashcard_web/index.do
Or
http://localhost:8080/IEDU_Flashcard_web/index.do
URL Example with query
http://127.0.0.1:8080/IEDU_Flashcard_web/index.do?myParameter=“it is my power!”
http://URL?varName=value&varName2=value2 …
Advanced URL Example
• http://127.0.0.1:8080/IEDU_Flashcard_web/userList.do