1
00:00:00,570 --> 00:00:01,430
Hi everyone.

2
00:00:01,570 --> 00:00:07,690
So here before the end in curly brace of this database handler class I'm going to create another method

3
00:00:07,960 --> 00:00:10,310
such as typing here public access modifier.

4
00:00:10,310 --> 00:00:11,570
This method is public.

5
00:00:11,620 --> 00:00:15,090
Now you need to reach specify the return type of this method.

6
00:00:15,160 --> 00:00:17,640
This is going to be martial art.

7
00:00:17,650 --> 00:00:27,480
The name of this method is going to be returned martial art object martial arts object by ID.

8
00:00:27,900 --> 00:00:28,250
OK.

9
00:00:28,350 --> 00:00:32,370
Bypassing the ID of a specific martial art object to dismember it.

10
00:00:32,420 --> 00:00:37,550
We can't get that specific martial art object that is related to that idea.

11
00:00:37,670 --> 00:00:39,090
So just put part of practice.

12
00:00:39,110 --> 00:00:44,690
And if you need to pass up an argument and you even need to specify a parameter of that integer for

13
00:00:44,690 --> 00:00:50,630
this method which is going to be the ID and just open and close this method by using these curly braces.

14
00:00:51,170 --> 00:00:57,540
So first of all we need to get the database so as a database database assignment operator get write

15
00:00:57,540 --> 00:01:03,590
up a database semi-colon and that we need to specify DSU l.com acquire the comment.

16
00:01:03,630 --> 00:01:04,650
So just I've in here.

17
00:01:04,650 --> 00:01:10,000
Strange as well a query come and ask as usual query comment.

18
00:01:11,620 --> 00:01:12,680
Assignment operator.

19
00:01:12,880 --> 00:01:20,960
Just put two quotes here again just they've been here select thought from and then put our space here

20
00:01:21,380 --> 00:01:23,360
and then put a contamination operator here.

21
00:01:23,360 --> 00:01:26,360
Now we need to refer to our table Marshall's table.

22
00:01:26,570 --> 00:01:30,610
Just put another concatenation operator here because we need to specify that.

23
00:01:30,680 --> 00:01:34,020
Give me a modular object that is related to this ID.

24
00:01:34,220 --> 00:01:36,520
So I'll put another concatenation operator here.

25
00:01:36,680 --> 00:01:42,820
And I just put two coats Yelle space where space plus and I just need to say.

26
00:01:42,830 --> 00:01:51,260
Actually I just need to refer to the key id key where Id key is space two quotes.

27
00:01:51,350 --> 00:01:59,330
I just need to put a concatenation operator here so plus two codes space equal operator space.

28
00:01:59,330 --> 00:02:04,620
And then here I just need to put a concatenation operator again Id semicolon.

29
00:02:04,790 --> 00:02:14,510
So here what I'm saying is select from martial arts table that object a module object where the ID is

30
00:02:14,540 --> 00:02:19,110
equal to the idea that the past to this method is argument.

31
00:02:19,130 --> 00:02:25,310
So in this way it's going to give us a specific object that is related to this ID here.

32
00:02:25,370 --> 00:02:30,740
So now after this line of code again we need to have an object of type cursor in order to process this

33
00:02:30,740 --> 00:02:31,410
as well.

34
00:02:31,430 --> 00:02:32,610
Querrey comment.

35
00:02:32,680 --> 00:02:42,770
So just typing here cursor on the name is cursor assignment operator database that's rather quirky.

36
00:02:43,110 --> 00:02:47,940
And here we need to pass these Escurial query command for the selection.

37
00:02:47,970 --> 00:02:51,620
Just put a comma here and pass the value not semicolon.

38
00:02:51,990 --> 00:02:58,470
So now that we have this cursor here to return type of this method is actually the martial art of martial

39
00:02:58,470 --> 00:02:58,910
art.

40
00:02:58,950 --> 00:03:04,710
You need to create a body but of a martial art here so that at the end of this if we can retain that

41
00:03:04,800 --> 00:03:05,890
object from the Smurfette.

42
00:03:05,880 --> 00:03:08,740
So let's create a value of type martial art.

43
00:03:09,240 --> 00:03:13,080
And here the name is martial art object OK.

44
00:03:13,270 --> 00:03:18,340
And then put an assignment operator here and initially passed a value to this body about because it

45
00:03:18,340 --> 00:03:20,080
is actually a local variable.

46
00:03:20,200 --> 00:03:25,830
It's important that the initial I said so we assigned the value not to this value but initially.

47
00:03:25,970 --> 00:03:31,150
So after this line of code let's create an if statement if cursor

48
00:03:34,100 --> 00:03:41,570
move to first move to first because we want to only get one specific martial art object that is related

49
00:03:41,570 --> 00:03:42,760
to this ID.

50
00:03:42,830 --> 00:03:47,830
This time we are going to use move to first because we only have one model that objects right.

51
00:03:47,840 --> 00:03:49,700
We only need to check for this condition.

52
00:03:49,730 --> 00:03:56,390
Move to first and an open and close this if statement by using these curly braces we can assign a real

53
00:03:56,390 --> 00:03:58,930
object to this object.

54
00:03:58,980 --> 00:04:05,540
But so I can say martial art object assignment operator new new martial art.

55
00:04:05,570 --> 00:04:06,320
And here we are.

56
00:04:06,350 --> 00:04:09,500
You are actually calling the constructor of this martial art class.

57
00:04:09,500 --> 00:04:11,320
So first we need to pass the ID.

58
00:04:11,330 --> 00:04:15,400
So again just they've been here integer that parse.

59
00:04:16,100 --> 00:04:22,040
And inside the Franz's it's just sitting here cursor that gets strange the column index is going to

60
00:04:22,040 --> 00:04:25,650
be actually 0 right comma.

61
00:04:25,790 --> 00:04:27,560
Let's create a new line here.

62
00:04:27,830 --> 00:04:32,150
And for the second argument here we need to actually get the name.

63
00:04:32,300 --> 00:04:41,850
So I can just say cursor does get strange and we need to pass the column in which is number one comma.

64
00:04:42,310 --> 00:04:45,190
And here we need to get to actually there.

65
00:04:45,220 --> 00:04:46,470
Marshall Price.

66
00:04:46,570 --> 00:04:53,270
So cursor that gets double the column and this is number two comma.

67
00:04:53,440 --> 00:04:54,960
Let's create a new line here.

68
00:04:54,970 --> 00:05:00,430
And finally we want to get a court martial art color which is of type string.

69
00:05:00,430 --> 00:05:06,040
So cursor that gets strange and the column index is number three.

70
00:05:06,190 --> 00:05:06,700
Right.

71
00:05:06,700 --> 00:05:08,610
Finally just put a semicolon here.

72
00:05:08,950 --> 00:05:14,900
And after this if statement here first we need to close the database so that it happens that close.

73
00:05:15,460 --> 00:05:18,010
And we need to return the martial art object.

74
00:05:18,010 --> 00:05:21,170
So martial art returned Marshall object semi-colon.

75
00:05:21,310 --> 00:05:22,060
So that's it.

76
00:05:22,080 --> 00:05:26,600
And this is our return martial art object method by ID.

77
00:05:26,780 --> 00:05:28,760
So that's enough for this class.

78
00:05:28,760 --> 00:05:32,160
They tell us of a class and that's enough for this tutorial too.

79
00:05:32,330 --> 00:05:36,590
So if you have any questions about the concepts that I taught you so far please post a discussion in

80
00:05:36,590 --> 00:05:40,320
the course and I do my best to answer all of your questions in the next story.

81
00:05:40,320 --> 00:05:45,020
Are we going to go ahead and we're going to work with them actually with the other class and other activity

82
00:05:45,020 --> 00:05:48,850
which is called the add activity at Marshall activity class.

83
00:05:48,880 --> 00:05:52,630
So thank you very much for watching and I'll see you in the next tutorial.

