YouTube2Text

Application Design and Development/1 — Transcript

by Data Base Management System - IITKGP · 5,004 words · 819 segments · language en · Watch on YouTube

Full transcript

  1. 0:00[Music]
  2. 0:16welcome to module 21 of database
  3. 0:20management systems
  4. 0:22in this module and the next two we will
  5. 0:24discuss about
  6. 0:25application design and development
  7. 0:29in the last week
  8. 0:31we have
  9. 0:32for the whole week in the five modules
  10. 0:34we have discussed about relational
  11. 0:36database design
  12. 0:38in depth we have looked into what are
  13. 0:40the different aspects of that
  14. 0:42and now we get into the core issue of if
  15. 0:46i have a relational database design
  16. 0:49existing and that is populated with the
  17. 0:51data
  18. 0:52then based on that how do we
  19. 0:54develop how do we create an application
  20. 0:58where the user can interact and actually
  21. 1:01ah get answers to the questions that the
  22. 1:04user has or the user can actually update
  23. 1:08ah the data create new data remove old
  24. 1:11data and so on
  25. 1:13so we would in that process like to
  26. 1:15familiarize with the fundamental notions
  27. 1:19of
  28. 1:20notions and technologies of
  29. 1:22web applications
  30. 1:24and
  31. 1:25specifically we would learn about
  32. 1:27servlets and java server pages
  33. 1:31so these are the three topics to be
  34. 1:33covered
  35. 1:34so we first start with application
  36. 1:36programs and user interfaces
  37. 1:39so the situation is where we do have a
  38. 1:43relational database design its populated
  39. 1:46with
  40. 1:47the required data but
  41. 1:50how about the interaction with the user
  42. 1:54incidentally most of the you database
  43. 1:56users do not
  44. 1:58interact
  45. 1:59with the database or query the database
  46. 2:02using language like sql because as you
  47. 2:05have seen it is not a very friendly
  48. 2:08language
  49. 2:09and it is not presentable in a way which
  50. 2:12i would we would
  51. 2:14always expect or we would like
  52. 2:16so
  53. 2:19usually an application program acts as a
  54. 2:22as we say as an intermediary between the
  55. 2:24user and the database and
  56. 2:27it is often split into
  57. 2:29three
  58. 2:30layers as we will say front end middle
  59. 2:32layer and back end
  60. 2:34so on the right i have shown these three
  61. 2:37layers we will talk more about that this
  62. 2:39is just a representative diagram
  63. 2:41so the front end is
  64. 2:44the user interface it is also called the
  65. 2:46presentation layer so it is the
  66. 2:49the layer where it is a part of the
  67. 2:52application where there are forms guis
  68. 2:56and different
  69. 2:58ways to
  70. 3:00input as well as get output of the data
  71. 3:03which is directly interacting with the
  72. 3:05user
  73. 3:06then we have a middle layer or it is
  74. 3:09also called
  75. 3:10the business logic layer or the
  76. 3:12application layer where the
  77. 3:15functionality of the application the
  78. 3:16required the operations of the or
  79. 3:19desired behavior of the application are
  80. 3:22coded and its kind of acts as a link
  81. 3:24between the front end
  82. 3:26and the back end
  83. 3:28and what is the back end back end is the
  84. 3:30actual data access layer or it is where
  85. 3:34the persistent data the database that we
  86. 3:36have created ah exist it is typically
  87. 3:40large in volume needs efficient access
  88. 3:42and so on
  89. 3:43so in this module we will try to
  90. 3:46understand as to how such what are the
  91. 3:49different requirements and what are the
  92. 3:50different technologies involved in
  93. 3:52creating such a layered application
  94. 3:56now if we historically look at so here
  95. 3:58we are just showing ah three phases
  96. 4:02initially 60s and 70s where the first
  97. 4:05data based application started
  98. 4:07then the
  99. 4:09interaction used to be text based from
  100. 4:11the terminal and
  101. 4:13those used to directly connect to the
  102. 4:16mainframe computer where the data
  103. 4:18existed through either a direct
  104. 4:20connection dialogue phone or proprietary
  105. 4:23network and as we moved to the 80s then
  106. 4:26we saw the advent of ah local area
  107. 4:28network so application programs or
  108. 4:30desktop
  109. 4:31would interact with the database through
  110. 4:33these
  111. 4:34local area networks
  112. 4:36and
  113. 4:38beyond that we have the what we call the
  114. 4:40web era which is nineteen ninety nine
  115. 4:43nineteen ninety onwards when the that's
  116. 4:45that's about roughly the last thirty
  117. 4:47years where typically the applications
  118. 4:50are now based on
  119. 4:52web browsers so the front end where we
  120. 4:55actually interact our web browsers and
  121. 4:58that connect to the web application
  122. 5:01server the database everything through
  123. 5:02an internet
  124. 5:04and i must
  125. 5:06tell you at this point that
  126. 5:08when you say this is the architecture it
  127. 5:10does not necessarily mean
  128. 5:12that the cloud shown as internet will
  129. 5:14have to be the web
  130. 5:16it could be an internet which is created
  131. 5:19with a set of systems within your
  132. 5:22organization which we typically call is
  133. 5:24an intranet or couple of
  134. 5:27organizations across which you say are
  135. 5:29extranet or it could even be a set of
  136. 5:32systems which are connected through the
  137. 5:35internet protocol within your lab or it
  138. 5:38could even be a
  139. 5:40single computer in which all these
  140. 5:43layers are integrated together but by
  141. 5:46internet we mean this is a internet
  142. 5:48protocol and technologies will be used
  143. 5:50for doing this interaction
  144. 5:53so web interface has become the de facto
  145. 5:56standard which gives a very distributed
  146. 5:59access to the database enables large
  147. 6:01number of users to access together and
  148. 6:05it avoids the requirement of downloading
  149. 6:08or installing specialized code into that
  150. 6:11all that we need is just a web browser
  151. 6:14and
  152. 6:15we have
  153. 6:16seen we are living through a variety of
  154. 6:19applications which are of this kind
  155. 6:22the banking applications the airline and
  156. 6:24railway reservations car rental hotel
  157. 6:26booking our web mail systems we
  158. 6:31check
  159. 6:32mail in gmail or yahoo those are all
  160. 6:36different web interfaces through which
  161. 6:38we actually access a the required set of
  162. 6:41databases
  163. 6:43and every even even every ah enterprise
  164. 6:47operations the erp
  165. 6:50are now web based and that is become the
  166. 6:52de facto standard
  167. 6:54so in the web interface ah along with
  168. 6:57the web interface which has been
  169. 6:59emerging of let of the last about 10
  170. 7:02years are mobile interfaces that we are
  171. 7:05getting used to using such applications
  172. 7:08from our mobile phone or tablet
  173. 7:10and these are similar in architecture
  174. 7:13and workflow as of the web application
  175. 7:16but there are significant differences
  176. 7:18too and at a later point
  177. 7:20in the next module we will discuss about
  178. 7:23the specific requirements of mobile apps
  179. 7:25in this context as well
  180. 7:28so before we move forward in terms of
  181. 7:30the details of how to build these
  182. 7:33applications we need to familiarize
  183. 7:35ourselves with the ah basic notions of
  184. 7:38the
  185. 7:38web as such so we call them as web
  186. 7:41fundamentals
  187. 7:43so web is a distributed information
  188. 7:44system which is based on hypertext hyper
  189. 7:47text is one where you have a part of the
  190. 7:50text available to you and then you have
  191. 7:52links we say are hyperlinks which can
  192. 7:55connect to the different documents
  193. 7:57contents which are located at other
  194. 8:00places at other servers
  195. 8:02and typically most web documents are
  196. 8:05hyper text documents which are formatted
  197. 8:08in terms of what we know as html hyper
  198. 8:11text markup language you will be
  199. 8:14familiar with that i am sure
  200. 8:16so they contain text and along with that
  201. 8:18they can have
  202. 8:20other
  203. 8:21components like images video the text
  204. 8:24has specifications for font color style
  205. 8:27all that and in addition there are forms
  206. 8:29which can be used to enter data
  207. 8:32and send them back to the web server
  208. 8:36now naturally when we operate on the web
  209. 8:39we need to ah
  210. 8:41have the functionality of pointing to
  211. 8:44different resources and this is done by
  212. 8:46what is known as url or uniform resource
  213. 8:49locator so that is a url is a procedure
  214. 8:52through which you can identify and point
  215. 8:55to a certain
  216. 8:56ah specific location of content so here
  217. 8:59i am showing an example of
  218. 9:02such a url all of you would be familiar
  219. 9:04with urls but just to look into the
  220. 9:06different components the first component
  221. 9:08http colon
  222. 9:10this http is actually a
  223. 9:13ah tells us the way the content would be
  224. 9:16accessed and this is typically called a
  225. 9:18protocol http stands for hyper text
  226. 9:22transfer protocol which allows you
  227. 9:24different text to be accessed
  228. 9:26the second component
  229. 9:28in this url which is between the two
  230. 9:30forward slash and the next slash
  231. 9:33www.acm.word.js
  232. 9:36identifies uniquely identifies a machine
  233. 9:39on the internet ah you will understand
  234. 9:42this is a symbolic name and the actual
  235. 9:44machine has what is known as an ip
  236. 9:46address
  237. 9:47and we will not go into those details
  238. 9:50but for us it is enough to understand
  239. 9:52that
  240. 9:54www.acm.org here is uniquely
  241. 9:59relatable to a particular machine on the
  242. 10:02internet and the last part which is
  243. 10:04remaining sigmoid and if there are more
  244. 10:07and more and more parts then it
  245. 10:09identifies the document inside within
  246. 10:11that machine
  247. 10:13so url can be used in
  248. 10:16multiple other ways also for example i
  249. 10:19can use a url locator to specify a file
  250. 10:22in my machine for example i have shown
  251. 10:25an example of an avi file in my ah c
  252. 10:28drive
  253. 10:29in windows and that is done through a
  254. 10:32similar url where the protocol is not
  255. 10:34http the protocol is file telling me
  256. 10:37that it is actually residing in my local
  257. 10:40machine so i have shown two ways to
  258. 10:43ah to look at that and you will see that
  259. 10:47between the two forms if you look at the
  260. 10:49second form you can easily
  261. 10:51understand that the machine to be
  262. 10:54identified is called the local host
  263. 10:57and in the first form that part is
  264. 11:00missing because it is by default the
  265. 11:03machine where i am running this code and
  266. 11:05rest of it is same which is basically
  267. 11:07the i identifying the document to be ah
  268. 11:12to be located in that machine similar ah
  269. 11:15this such url can also in the last
  270. 11:18example you can see that
  271. 11:20www.google.com is the
  272. 11:23basic machine where i am putting the
  273. 11:27url
  274. 11:28and then the rest of it is search so
  275. 11:31which actually takes it to a document
  276. 11:33where where i tell
  277. 11:35the search to be performed and then
  278. 11:36there are parameters to this
  279. 11:38form
  280. 11:39the parameter is q is equal to salvage
  281. 11:42search which is equivalent to
  282. 11:44saying that i am asking google.com to
  283. 11:47search for contents which have silvered
  284. 11:49such in it
  285. 11:50so this is a basic purpose of the
  286. 11:53uniform resource locator or url
  287. 11:56incidentally you may have heard the
  288. 11:58names like uri
  289. 12:00and urn in addition to url
  290. 12:03so they are related but they mean little
  291. 12:06bit different things as this venn
  292. 12:08diagram shows so a uri can be either a
  293. 12:12url or a urn or it could be both so urn
  294. 12:17functions like a person's name so you
  295. 12:19can consider it that way universal
  296. 12:22resource name and url resembles that of
  297. 12:25a
  298. 12:26person's street address so url says what
  299. 12:28is the name of the content and url says
  300. 12:31where that can be found and
  301. 12:34uri in general could be either the name
  302. 12:36or the address or both of them
  303. 12:39ah you we in this context of our
  304. 12:42discussion we will continue to use the
  305. 12:44term url only but i just wanted you to
  306. 12:47be aware of the other two terms in case
  307. 12:50you come across them in the text
  308. 12:54so
  309. 12:55we know by now that http
  310. 12:57html provides the formatting the
  311. 12:59hypertext links images and so on and
  312. 13:02http provides the protocol through which
  313. 13:05the contents are exchanged between
  314. 13:08ah different machines in the internet
  315. 13:11so you can select from a set of options
  316. 13:15in terms of html
  317. 13:18pop-up menus radio buttons ah check
  318. 13:20boxes and so on you can enter values
  319. 13:23through text box and once a form has
  320. 13:25been filled up that form will be sent
  321. 13:28back to the server from where it came
  322. 13:31and will be acted upon by the server
  323. 13:36http helps in that transfer mechanism
  324. 13:39so here is a sample html code let me ah
  325. 13:43show you the effect of this in the next
  326. 13:45slide so if you
  327. 13:47look in here then you can see that
  328. 13:50these are this is what
  329. 13:52is known as a tag
  330. 13:54and it kind of the tags are kind of
  331. 13:57given in the form of parenthesis
  332. 13:59notation so it has a has a opening and a
  333. 14:02closing and these have to have to
  334. 14:05actually match and you can see that the
  335. 14:08ah
  336. 14:09opening is written within the corner
  337. 14:11brackets and the closing you cite the
  338. 14:13same tag name
  339. 14:14but you put a forward slash before the
  340. 14:16name
  341. 14:18and then
  342. 14:19between the closing
  343. 14:22opening and the closing you can write
  344. 14:23more
  345. 14:24tabs in a nested manner so here it says
  346. 14:27that i have html which has a body
  347. 14:30and that body spans ah this much
  348. 14:33and then we are saying that there is a
  349. 14:35table so this is the table that you can
  350. 14:37get to see
  351. 14:38and
  352. 14:39then it also says that there is a form
  353. 14:42and this is a form that you get to see
  354. 14:45within the table you can see so it is
  355. 14:48saying that
  356. 14:49this is an id
  357. 14:51there is a name so it is describing the
  358. 14:53first row the department so you can see
  359. 14:56each one of them the the id is here
  360. 15:00the name is here
  361. 15:01the department is here
  362. 15:03similarly this is a next row where it is
  363. 15:06saying it is 0 1 0 0 1 to 8 zhang
  364. 15:10computer science so this is how you can
  365. 15:12you actually in an html in a text form
  366. 15:15all these details will be given and when
  367. 15:18it is
  368. 15:19ah rendered by the web browser then you
  369. 15:22will see a table like this
  370. 15:24similarly here we are
  371. 15:26i am showing a an instance of a form
  372. 15:29which is used to input data so we are
  373. 15:33saying that here is a is a drop down and
  374. 15:36its written out here in terms of options
  375. 15:39so the first option student is is
  376. 15:41visible here if you drop down you will
  377. 15:44actually see another option instructor
  378. 15:46here you will not see that because it is
  379. 15:48a frozen image
  380. 15:49so and then
  381. 15:51i i have a qualifier name and there is a
  382. 15:54input text box where you can input any
  383. 15:59string up to size 20 and once this has
  384. 16:02been done then you have a
  385. 16:05input which is submit which is the
  386. 16:07submit button here which shows that you
  387. 16:10can now submit and then this form filled
  388. 16:12up form will be sent back to the web
  389. 16:15browser from where it originally came
  390. 16:17so this is the basic
  391. 16:19mechanism of html ah you can
  392. 16:23learn little bit more about that and get
  393. 16:26familiar with it
  394. 16:27so a document name in a url may identify
  395. 16:31a a program that is written that
  396. 16:34generates so html could be either
  397. 16:36at the url in the web server you can
  398. 16:38either have html which we say is a
  399. 16:40static html
  400. 16:42or
  401. 16:43you could actually have a program which
  402. 16:46when you send the request it actually
  403. 16:49for example when you are doing google
  404. 16:51you said
  405. 16:52www.google.com
  406. 16:55search question mark q
  407. 16:58is has a value silver search then
  408. 17:00actually at that location there is no
  409. 17:04html currently existing which contains
  410. 17:07the search result but instead there is a
  411. 17:11program
  412. 17:12which will be executed based on the
  413. 17:15submission of this form and when run
  414. 17:17that will generate a html document
  415. 17:20and once that is generated then this
  416. 17:23will be
  417. 17:24passed back to the ah to your web
  418. 17:27browser so that is the basic mechanism
  419. 17:29so
  420. 17:30if you want a new service on the web
  421. 17:32then all that you simply need to do is
  422. 17:34to create and install a new program that
  423. 17:38will provide that service and through
  424. 17:39this process will see how easily this
  425. 17:42can be done
  426. 17:43and how web browser provides a graphical
  427. 17:45interface to this information service
  428. 17:48there is
  429. 17:49there has been another other other
  430. 17:51mechanisms of doing similar things also
  431. 17:54which was particularly popular earlier
  432. 17:56called the common
  433. 17:57gateway interface or cgi but now we have
  434. 18:00various other ways of doing the same
  435. 18:02thing
  436. 18:04so in this context then the basic three
  437. 18:08layers that we started discussing with
  438. 18:10are here so this is the most common way
  439. 18:13an application is
  440. 18:14so this is where your
  441. 18:16your
  442. 18:17front end is where you have the browser
  443. 18:19where you see that this is the network
  444. 18:21we are just in general writing network
  445. 18:23it could be internet it could be
  446. 18:24internet
  447. 18:26and a web server so when you send a
  448. 18:28request it is received by the web server
  449. 18:31web server somehow
  450. 18:33computes a result html and that sent
  451. 18:36back to the browser and that is how the
  452. 18:38interaction keeps on happening
  453. 18:40so the browser
  454. 18:41and the web server together often would
  455. 18:44be referred to as a front end because
  456. 18:46that gives a presentation that presents
  457. 18:49the results the interaction to you
  458. 18:52the next is the application layer which
  459. 18:54is the business logic where you write
  460. 18:56and then you have the data access layer
  461. 18:58or the database server and these are the
  462. 19:00actual disks where the data exist so
  463. 19:02this is a tier one this is tier two and
  464. 19:05this is tier three which is a very
  465. 19:07typical ah way a web
  466. 19:11application will be architected and
  467. 19:14these are the three layers or three
  468. 19:16tiers that we will usually find
  469. 19:19so
  470. 19:21often
  471. 19:22actually 3 is not a very magical number
  472. 19:25in terms of tiers it is possible that
  473. 19:27you could have
  474. 19:28more some applications have more tiers
  475. 19:31and some applications may choose to have
  476. 19:34multiple functionality in the same layer
  477. 19:36for example web server and application
  478. 19:38server functionality could be clubbed
  479. 19:39together and when this is done we say
  480. 19:42that we then have only two layers so the
  481. 19:44front end and the middle layer are
  482. 19:46merged together and the back end or the
  483. 19:48database server becomes a second layer
  484. 19:51so we would often might want to do that
  485. 19:54the reason we do that
  486. 19:56and i will just take you back to the ah
  487. 19:58three layer view so if ah
  488. 20:01the question is naturally if we have
  489. 20:04the web server and we have this
  490. 20:05connection this is clear now the
  491. 20:07question is what is this connection and
  492. 20:09what is this connection
  493. 20:11is it necessary that they will have to
  494. 20:13be on the same server physically
  495. 20:16or will they be on can be on different
  496. 20:18server and servers could be connected
  497. 20:20through a lan
  498. 20:21or they themselves could be on
  499. 20:24different
  500. 20:25servers over the internet and may they
  501. 20:27may be connected to internet so all of
  502. 20:29these are possibilities
  503. 20:31and the way we connect is the way we
  504. 20:35will write the application will be will
  505. 20:38not depend on the way these servers are
  506. 20:40connected between each other we will
  507. 20:42often assume that as if they are
  508. 20:45connected over a net
  509. 20:47and write it in a way so that even when
  510. 20:49they may be connected over a land or
  511. 20:52even when they may actually be on the
  512. 20:54same machine things will work in the
  513. 20:56same way
  514. 20:58now one point that
  515. 21:00should be born in mind in terms of the
  516. 21:02http protocol is it is connectionless so
  517. 21:05this is a very very critical concept and
  518. 21:08it means that once i start the process i
  519. 21:13have an url i
  520. 21:14submit that and that goes to the server
  521. 21:16the server runs an application or it is
  522. 21:19a static page server picks up and
  523. 21:21returns me that html
  524. 21:22the http loop is closed so that is all
  525. 21:26that happens and when i submit again
  526. 21:29something based on that so i have gone
  527. 21:32to gmailmail.google.com
  528. 21:34i submit that and i get back a
  529. 21:38form
  530. 21:39ah which tells me to put my user id and
  531. 21:42login i do that i submit and that when
  532. 21:45that goes then there is no memory about
  533. 21:48the earlier
  534. 21:50interaction that has happened
  535. 21:51so when my login submission goes it is
  536. 21:54authenticated in the back end i am able
  537. 21:57to login and i am given back
  538. 22:00the first screen of my mailbox which is
  539. 22:03the inbox screen and as soon as i get
  540. 22:06that inbox
  541. 22:08the html containing the inbox on my
  542. 22:11browser that transaction has also been
  543. 22:13over
  544. 22:15so if i now want to look at a specific
  545. 22:17mail it has to be a new query and it
  546. 22:20does not remember anything from the
  547. 22:21previous query
  548. 22:23so this connectionless property
  549. 22:25naturally makes it
  550. 22:27make certain things more difficult you
  551. 22:30will you will
  552. 22:32realize that many of the other
  553. 22:34connections that we do for example if we
  554. 22:36login to unix
  555. 22:38system or to a windows system if we use
  556. 22:40some database connections they are
  557. 22:43connected till the cl we disconnect them
  558. 22:46but in http it is not so it is
  559. 22:48connectionless every time you do you you
  560. 22:50have a separate
  561. 22:52session
  562. 22:53so naturally the question ah this was i
  563. 22:56mean there are there are reasons of why
  564. 22:58it is done this way it is to reduce load
  565. 23:00on the server and so on but naturally
  566. 23:02the consequences therefore we cannot
  567. 23:05remember information from one request
  568. 23:07response
  569. 23:09loop to the next so
  570. 23:12if i have logged in to my mail
  571. 23:14gmail account and i have seen the i have
  572. 23:17got the inbox
  573. 23:18then when i want to check my first mail
  574. 23:21the system does not
  575. 23:22know anymore that i am logged in because
  576. 23:25that session risk based response has is
  577. 23:27over and now i am making a new request
  578. 23:29that show me the first mail and i expect
  579. 23:32to see the whole body
  580. 23:33so there is no information that is
  581. 23:35carried from one request to the other
  582. 23:37which makes
  583. 23:39http difficult to work with so the
  584. 23:42solution for that is something which is
  585. 23:45known as a cookie
  586. 23:47so a cookie is a small piece of text
  587. 23:49which contain information ah which is
  588. 23:53identifying and which can go back and
  589. 23:56forth between the browser and the server
  590. 23:59so
  591. 24:00first it is sent by the server to the
  592. 24:02browser and the what the browser does so
  593. 24:04this happens the first time so when we
  594. 24:06have logged in my browser has got it got
  595. 24:08some cooking from the
  596. 24:10mail
  597. 24:11gmail server
  598. 24:13then
  599. 24:14the browser can send it back to the
  600. 24:16server when it is doing the next
  601. 24:19request so that i can be identified as
  602. 24:22the logged in person
  603. 24:24and so the browser can keep it
  604. 24:27as a i mean locally in in its memory or
  605. 24:30locally here and thats a part of the
  606. 24:33http protocol so this keeps on this
  607. 24:36cookie keeps on going back and forth
  608. 24:38back and forth so every time i send a
  609. 24:40request the cookie actually has to go to
  610. 24:42tell the server that yes this is part of
  611. 24:45pratim dash who is already logged in and
  612. 24:48authenticated himself for checking his
  613. 24:50mails
  614. 24:51so cookies are a big convenience and
  615. 24:55they are a very important factor of the
  616. 24:57web application so they can be stored
  617. 25:00permanently or for a limited period of
  618. 25:03time
  619. 25:05ah next
  620. 25:07let us look into some of the core
  621. 25:09technologies that are involved the first
  622. 25:12technology is
  623. 25:13is called a servlet servlet is nothing
  624. 25:15but as you can understand from the name
  625. 25:17itself is as we have book booklet
  626. 25:19booklet is a small very small book
  627. 25:21servlet is a very small server so it is
  628. 25:23a java application which can do certain
  629. 25:25tasks so it is a kind of an application
  630. 25:27program
  631. 25:28and ah every time we request then the
  632. 25:31server actually spawns a new thread
  633. 25:34and
  634. 25:35in that thread this
  635. 25:37servlet would be running and once the
  636. 25:40request is serviced the thread will be
  637. 25:42closed so this is a typical ah
  638. 25:44server servlet view so which shows that
  639. 25:48in the servlet you are creating actually
  640. 25:50creating the requested i mean possible
  641. 25:53html response that you would like to
  642. 25:54have so there are ah so there are
  643. 25:58different details you can read through
  644. 26:00that so this is a typical servlet code
  645. 26:02so it actually is a is a java code which
  646. 26:05it through print line will generate
  647. 26:08different lines of the html
  648. 26:11now naturally sublets maintain sessions
  649. 26:14the way we talked about
  650. 26:17so that through an interaction i can
  651. 26:19continue to be identified and the
  652. 26:22servlet can check whether the session is
  653. 26:24on or the session is already over
  654. 26:28so these are these are the different
  655. 26:30ways of doing that in terms of checking
  656. 26:32the user id and several web servers
  657. 26:36application servers have support for
  658. 26:38servlet apache tomcat is one of the very
  659. 26:41popular ones which you must have heard
  660. 26:43the name of
  661. 26:44and there but there are several other
  662. 26:46servers as well
  663. 26:49now
  664. 26:50along with the servlet there is another
  665. 26:52concept which is called server side
  666. 26:54scripting
  667. 26:55surface scripting is a is a mechanism
  668. 26:58where you define an html document and
  669. 27:02within that
  670. 27:03html document
  671. 27:05ah can be used so you may have some
  672. 27:08inputs to that and they can be used to
  673. 27:12directly fire embedded sql queries so we
  674. 27:15talked about embedding of sql query in
  675. 27:18while we discussed about the basic
  676. 27:20mechanism of host language and query
  677. 27:23language so here the html kind of a
  678. 27:26language is a host and you can embed the
  679. 27:29query right in a as a part of that
  680. 27:33and so that query goes to the database
  681. 27:36query server and you get the answer and
  682. 27:38that answer is
  683. 27:40placed where your original query was
  684. 27:44there so that you continue to get very
  685. 27:47easily a complete html as a response
  686. 27:50so this kind of a mechanism it makes it
  687. 27:53very easy because it is quite easy to ah
  688. 27:56conceive of the html and fill in so if i
  689. 28:00have asked for say
  690. 28:02logged in to the my mail
  691. 28:05gmail service then i have given the
  692. 28:07input as my username password and when
  693. 28:09that got gets authenticated then i get a
  694. 28:12response which is
  695. 28:14select
  696. 28:16mail from different respective tables
  697. 28:19where my authentication is there the
  698. 28:22user name is ppd and so on
  699. 28:24so it becomes quite easy to
  700. 28:27actually create the html and there are
  701. 28:30several such scripting languages jsp and
  702. 28:32php are the most popular ones
  703. 28:36so this is how a a typical
  704. 28:39jsp will look like so you can see that
  705. 28:41this actually looks like html but inside
  706. 28:44that you have a you have some part of a
  707. 28:46java code so what will happen the body
  708. 28:48will get replaced
  709. 28:50when the ah
  710. 28:52when the
  711. 28:53response has come for example here the
  712. 28:55response is ah doing a hello world so
  713. 28:58when this is executed then whatever is
  714. 29:01the result will replace the body in the
  715. 29:03html here and the resultant html will
  716. 29:05get generated
  717. 29:11there is another mechanism of scripting
  718. 29:14which is also very popular called php
  719. 29:17so this is how it is done
  720. 29:19similarly you could have
  721. 29:21scripts at the client side also for
  722. 29:23example if you are entering data for say
  723. 29:26a month
  724. 29:27and in numeric and you happen to enter
  725. 29:3014 then in most cases the page will
  726. 29:34immediately give you an error saying
  727. 29:36that 14 cannot be a valid month so there
  728. 29:38is a validation involved so in the
  729. 29:41client side in the browser there are
  730. 29:43some small scripts that can run is most
  731. 29:45typically it is a javascript which can
  732. 29:48do different authentication which is
  733. 29:50possible without actually accessing the
  734. 29:53data in the database you cannot for
  735. 29:54example validate a mail data based on
  736. 29:57the client side scripting sitting on the
  737. 29:59browser but you can
  738. 30:02validate small things like
  739. 30:04valid data forms range of data and so on
  740. 30:07and it is it is very important because
  741. 30:09if you could not do that then all you
  742. 30:11have required is you would have sent
  743. 30:13that faulty month numbered 14 to the to
  744. 30:17this back end server and got an error
  745. 30:19and you would have come back and then
  746. 30:21had to correct it but you can do this
  747. 30:23locally at the browser itself
  748. 30:26so client side scripting has a lot of
  749. 30:28value but you will have to have to
  750. 30:29remember that if you are doing client
  751. 30:32side scripting then there are security
  752. 30:34issues because
  753. 30:36it is
  754. 30:37quite possible that if we are doing
  755. 30:40things on the client side that is on the
  756. 30:42browser then we might also inadvertently
  757. 30:45or by a malicious intent actually make
  758. 30:48damages to the machine on which the
  759. 30:50browser is running so there are
  760. 30:52different kinds of care that is to be
  761. 30:53taken for example java applet which is
  762. 30:56another way of doing
  763. 30:58client side computation disallows file
  764. 31:01rights and so on
  765. 31:03and javascript as i have said is widely
  766. 31:06used and it can function to check for
  767. 31:08input validity which i gave an example
  768. 31:10of it can modify the displayed web page
  769. 31:13it can communicate with the web server
  770. 31:14to fetch data and so on and its you
  771. 31:17should familiarize yourself with
  772. 31:18javascript more it is a very powerful
  773. 31:20mechanism to ah do compute the simple
  774. 31:24things at the client side this is an
  775. 31:25example that i have given so you can
  776. 31:27read through and you will be able to if
  777. 31:29you know java you will be able to
  778. 31:30understand javascript very easily you
  779. 31:33could get through that
  780. 31:34and ah
  781. 31:36so there are multiple options of doing
  782. 31:38such things but ah
  783. 31:40jsp has a has a unique position because
  784. 31:43it is very useful in many context so i
  785. 31:46say the jsp has certain usb like
  786. 31:50active server page which is used in
  787. 31:53terms of the microsoft platform
  788. 31:55ah is also another mechanism of doing
  789. 31:59server side scripting but jsp is better
  790. 32:01because it is portable
  791. 32:03in with respect to pure servlets which
  792. 32:06we showed you in the beginning jsp
  793. 32:08performs
  794. 32:09is easier to use because jsp
  795. 32:12has the structure of the html page
  796. 32:14whereas in a pure servlet you will have
  797. 32:15to use print line to print every tag of
  798. 32:19the html which is cumbersome
  799. 32:21jsp
  800. 32:22in contrast to javascript
  801. 32:24is certainly a different thing because
  802. 32:26javascript runs on the browser on the
  803. 32:28client side jsp runs on the server side
  804. 32:31and certainly jsp is
  805. 32:33compared to static html is more powerful
  806. 32:36because it can handle dynamic
  807. 32:38information
  808. 32:39so
  809. 32:40in this ah that brings us to the end of
  810. 32:42this current module so what we have done
  811. 32:45we have understood the basic
  812. 32:46requirements of database application
  813. 32:48programs and user interfaces understood
  814. 32:51the basic terminology of the web and
  815. 32:54took a look into the core notion core
  816. 32:57technologies of
  817. 32:59application development which is in
  818. 33:01terms of the servlets and java server
  819. 33:04pages

About this transcript

This page contains the full transcript of Application Design and Development/1 by Data Base Management System - IITKGP, generated from the public captions YouTube serves with the video. The transcript has 5,004 words across 819 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.