1
00:00:00,180 --> 00:00:05,050
So as you can see here these are the lines of code that I actually pay said here.

2
00:00:05,250 --> 00:00:09,980
So first of all as you can see I want to actually read some data from the database.

3
00:00:10,020 --> 00:00:10,590
OK.

4
00:00:10,590 --> 00:00:15,540
So as you can see I want to actually get a single computer object from the database and let the data

5
00:00:15,940 --> 00:00:23,190
add here as you can see in lines of 81 through 96 as you can see we have MFX and the access modifiers

6
00:00:23,190 --> 00:00:24,480
of this Smurfit is public.

7
00:00:24,570 --> 00:00:30,660
As you can see here and the return type of dismay for this computer and this means that this method

8
00:00:30,690 --> 00:00:34,190
is going to return an object of type computer.

9
00:00:34,260 --> 00:00:34,850
OK.

10
00:00:35,100 --> 00:00:38,110
And the name of this method is good computer.

11
00:00:38,130 --> 00:00:43,770
So this as you can see here actually accepts an argument of type integer and the name of this argument

12
00:00:43,800 --> 00:00:44,750
is ID.

13
00:00:44,760 --> 00:00:49,310
Now I am actually inside of this method inside the curly braces of this method method.

14
00:00:49,470 --> 00:00:52,650
So let's see what's going on here at the line 83.

15
00:00:52,740 --> 00:00:53,600
As you can see here.

16
00:00:53,820 --> 00:01:01,050
I created an object of type 2 like database and the name of this object is database assignment operator

17
00:01:01,450 --> 00:01:01,960
these.

18
00:01:02,010 --> 00:01:05,300
So this refers to this my is you a late handler class right.

19
00:01:05,480 --> 00:01:07,200
That gets readable database.

20
00:01:07,230 --> 00:01:10,280
So I want you to get the readable database OK.

21
00:01:10,500 --> 00:01:16,050
I want to get the database in order to read the data and I want to assign that database to this database

22
00:01:16,050 --> 00:01:16,440
here.

23
00:01:16,440 --> 00:01:19,190
As you can see here in line 84 here.

24
00:01:19,290 --> 00:01:22,280
I created this up interface here.

25
00:01:22,320 --> 00:01:25,350
As you can see this is actually an interface cursor.

26
00:01:25,470 --> 00:01:25,940
OK.

27
00:01:26,070 --> 00:01:28,180
And here I try to initialized this cursor.

28
00:01:28,320 --> 00:01:33,540
So now let's actually open and documentation and see what is this cursor interface.

29
00:01:33,540 --> 00:01:37,180
So here is the documentation and you can actually enter this.

30
00:01:37,200 --> 00:01:41,570
You are here on your web browser and then you will be guided to this page here.

31
00:01:41,580 --> 00:01:47,880
So this is actually a cursor here and this is an interface and it actually implements this close up

32
00:01:47,880 --> 00:01:49,240
an interface here.

33
00:01:49,290 --> 00:01:56,940
So let's read a description it says this interface provides a random read write access to the result

34
00:01:56,940 --> 00:02:00,140
set returned by your database query.

35
00:02:00,450 --> 00:02:07,280
So by using this a cursor interface I can actually query data from the database.

36
00:02:07,500 --> 00:02:11,370
OK so here I actually created this cursor here.

37
00:02:11,370 --> 00:02:17,850
Assignment operator and then I referred to the name of this database object that query as you can see

38
00:02:17,850 --> 00:02:18,390
here.

39
00:02:18,390 --> 00:02:24,600
Now you want to query data from the database so query these this Meffert this query if it actually accepts

40
00:02:24,600 --> 00:02:25,670
some arguments.

41
00:02:25,830 --> 00:02:29,310
The first argument is actually table computer as you can see here.

42
00:02:29,310 --> 00:02:30,700
This is the table computer.

43
00:02:30,720 --> 00:02:32,310
This is going to be the name of the table.

44
00:02:32,420 --> 00:02:32,950
OK.

45
00:02:33,080 --> 00:02:36,150
That you want to actually get the data up from this database.

46
00:02:36,150 --> 00:02:42,490
So now I want to actually call this method here again in order to show you the arguments.

47
00:02:42,510 --> 00:02:45,170
So database that query.

48
00:02:45,270 --> 00:02:49,950
So the first argument is going to be the table as you can see here strength table.

49
00:02:50,040 --> 00:02:54,290
The second argument is going to be the columns that are inside of that table.

50
00:02:54,390 --> 00:03:01,390
So here as you can see for the second argument I created an object of type upstreams Aure as you can

51
00:03:01,400 --> 00:03:09,030
see for the second argument we need on a string at a which actually includes the columns that are inside

52
00:03:09,030 --> 00:03:09,930
of that table.

53
00:03:09,930 --> 00:03:16,500
So here I created a string Arey object new string ID and inside the curly braces I assigned these objects

54
00:03:16,770 --> 00:03:18,830
that are inside of this at 8.

55
00:03:18,840 --> 00:03:21,600
So that's the first one is column ID.

56
00:03:21,600 --> 00:03:26,760
The second one is going to be column computer name and the third one is going to be Cullom a computer

57
00:03:26,760 --> 00:03:27,340
type.

58
00:03:27,450 --> 00:03:28,500
OK these are the columns.

59
00:03:28,500 --> 00:03:34,260
This is very important for the second argument and for the first argument we need to provide string

60
00:03:34,260 --> 00:03:35,130
selection.

61
00:03:35,130 --> 00:03:41,250
We need to provide a WHERE clause and of classes actually determines how we want to actually get the

62
00:03:41,250 --> 00:03:42,750
data from the database.

63
00:03:42,840 --> 00:03:48,240
For example as you can see here for the first argument which is actually this is actually of type streambed.

64
00:03:48,300 --> 00:03:50,850
And it says its name is selection.

65
00:03:50,850 --> 00:03:56,230
So I want to actually I used to refer to the name of this column column Id plus.

66
00:03:56,250 --> 00:04:00,450
And instead of double quotes on an equal operator here and then a question mark.

67
00:04:00,540 --> 00:04:08,130
And this means all you want to get this specific computer object that is actually related to a specific

68
00:04:08,220 --> 00:04:09,040
ID.

69
00:04:09,390 --> 00:04:15,740
Ok for example I want to actually get the first computer object that its ID is number one.

70
00:04:16,020 --> 00:04:16,420
OK.

71
00:04:16,470 --> 00:04:24,720
So in this way I can I try to get that computed object by providing the ID I can actually get the computer

72
00:04:24,720 --> 00:04:25,160
object.

73
00:04:25,260 --> 00:04:31,860
And that's why I actually specified that this is going to accept an argument of type integer and the

74
00:04:31,860 --> 00:04:34,060
name of this argument is ID.

75
00:04:34,110 --> 00:04:41,250
So by providing an ID for this method I can actually get this specific computed object.

76
00:04:41,250 --> 00:04:43,130
So that's the job of this very close here.

77
00:04:43,140 --> 00:04:48,370
Column ID plus an instead of double quotes like with an equal operator and the question mark.

78
00:04:48,510 --> 00:04:55,680
And this means that by providing an ID for the Smurfit is going to give me the specific computed object

79
00:04:55,680 --> 00:04:57,170
that is related to this ID.

80
00:04:57,360 --> 00:04:58,470
OK.

81
00:04:58,470 --> 00:05:03,880
And here as you can see for the argument here we have this selection artics.

82
00:05:04,040 --> 00:05:04,550
OK.

83
00:05:04,560 --> 00:05:10,410
So we need to actually provide arguments for these of our class here for this fair argument.

84
00:05:10,410 --> 00:05:14,090
So these are the arguments Neal which is actually of type string at a right.

85
00:05:14,130 --> 00:05:19,220
So we need to actually create an object of type string at a new string at a.

86
00:05:19,410 --> 00:05:25,030
And inside the curly braces we need to provide the objects three image that the value of ID the Smurfit

87
00:05:25,240 --> 00:05:31,290
this string that value of method actually accept a value of type integer and then it's going to return

88
00:05:31,350 --> 00:05:33,710
a string value from that integer value.

89
00:05:33,720 --> 00:05:39,930
So this I actually referred to the name of the string class that value of this value of is actually

90
00:05:39,930 --> 00:05:45,760
a static method inside the string class and it's going to accept a value of type integer.

91
00:05:45,780 --> 00:05:51,120
So here I passed this value ID which is actually integer and it's going to convert that value to a string

92
00:05:51,120 --> 00:05:51,960
value.

93
00:05:52,050 --> 00:05:55,610
So it's going to give me the string representation of that idea.

94
00:05:55,940 --> 00:05:56,400
OK.

95
00:05:56,460 --> 00:06:02,350
So this argument this representation of that idea is going to be an argument for this class.

96
00:06:02,490 --> 00:06:06,210
Yet as you can see Klallam Plus the equal operator question.

97
00:06:06,480 --> 00:06:08,830
This is going to be an argument for this one.

98
00:06:08,880 --> 00:06:15,210
And this means I want to actually get the ID that it's related to a specific computer object and I want

99
00:06:15,210 --> 00:06:17,460
to return that computer object.

100
00:06:17,720 --> 00:06:18,350
OK.

101
00:06:18,720 --> 00:06:24,510
And here for for these arguments I assigned the value for example for this group by having an order

102
00:06:24,510 --> 00:06:24,870
by.

103
00:06:24,960 --> 00:06:25,830
OK.

104
00:06:26,000 --> 00:06:28,470
Are you saying that value not because we don't need them.

105
00:06:28,470 --> 00:06:32,290
And here at the end of my statement I actually put a semicolon.

106
00:06:32,510 --> 00:06:33,020
OK.

107
00:06:33,120 --> 00:06:40,260
So in actuality this line of code here and here I created an if statement here and it's as if cursor

108
00:06:40,920 --> 00:06:45,650
this cursor here as you can see this interface as you can see here is not equal to null.

109
00:06:45,900 --> 00:06:48,290
OK cursor move to first.

110
00:06:48,360 --> 00:06:55,490
So this means that if we actually have some optics inside our database OK and we can actually read those

111
00:06:55,500 --> 00:07:00,630
data then it's going to go to their first object inside the database.

112
00:07:00,630 --> 00:07:02,060
Inside it is like database.

113
00:07:02,070 --> 00:07:06,980
If the cursor is equal to null then it's not going to actually go inside the database and read the data

114
00:07:07,020 --> 00:07:09,200
because we don't have data in our database.

115
00:07:09,390 --> 00:07:10,850
OK so this has been important.

116
00:07:11,310 --> 00:07:16,160
And in light 93 here I created an object of type computer.

117
00:07:16,230 --> 00:07:19,850
So tell me about this if it is going to return an update of the computer.

118
00:07:19,850 --> 00:07:26,070
If we pass the ID to the Smurfette and then it's going to return an object that is actually specific

119
00:07:26,070 --> 00:07:30,340
to that ID and then we can actually get that computed object.

120
00:07:30,420 --> 00:07:35,370
So in 93 I created an object of type computer assignment operator.

121
00:07:35,520 --> 00:07:39,350
And here I actually initialize this computer Optix new computer.

122
00:07:39,690 --> 00:07:45,620
So here we are actually providing free arguments for the constructor of this computer class.

123
00:07:45,840 --> 00:07:52,050
So inside this computer class remember that you had three constructors as you can see here and here

124
00:07:52,070 --> 00:07:54,140
in say this is tool like handler class.

125
00:07:54,240 --> 00:08:01,170
I want to call this one constructor that that actually accepts free arguments which is the computer

126
00:08:01,170 --> 00:08:02,850
name and computer type.

127
00:08:02,850 --> 00:08:05,790
So here as you can see new computer.

128
00:08:05,940 --> 00:08:08,480
And for the first argument we need to provide the ID.

129
00:08:08,550 --> 00:08:12,010
So I called this integer class data parsing.

130
00:08:12,030 --> 00:08:16,490
So this is going to accept a string value and then it's going to convert.

131
00:08:16,500 --> 00:08:20,160
That's why the gateway integer value so integer that parse.

132
00:08:20,550 --> 00:08:26,040
And for the argument of this parsing in Smurfette you refer to the name of this cursor object as you

133
00:08:26,040 --> 00:08:28,240
can see here cursor that get strange.

134
00:08:28,290 --> 00:08:33,990
So it's going to get this string representation of the first column the first column is actually column

135
00:08:33,990 --> 00:08:34,550
Id.

136
00:08:34,650 --> 00:08:35,630
As you can see here.

137
00:08:35,850 --> 00:08:38,940
So it's going to give me that string representation of that ID.

138
00:08:39,030 --> 00:08:39,450
OK.

139
00:08:39,570 --> 00:08:41,990
Which is going to be an integer value.

140
00:08:42,060 --> 00:08:46,920
So it's going to dismiss that person is going on is going to convert that's by the value to the integer

141
00:08:46,920 --> 00:08:47,700
value.

142
00:08:47,700 --> 00:08:53,040
And then we can actually put that's about you as the id of the constructor and for the second argument

143
00:08:53,190 --> 00:08:55,380
we need to think about your computer name.

144
00:08:55,380 --> 00:09:01,170
So inside this computer class as you can see for the second value of the second argument we need a string

145
00:09:01,190 --> 00:09:06,830
value computer name and for the first argument we need a string value again for the for the first argument.

146
00:09:06,840 --> 00:09:09,630
OK so this is the second argument as you can see here.

147
00:09:09,630 --> 00:09:10,670
String computer.

148
00:09:10,830 --> 00:09:12,390
And this is the first argument.

149
00:09:12,390 --> 00:09:17,520
So if you say this is like handler class for the second argument cursor that get string 1.

150
00:09:17,610 --> 00:09:23,940
This one refers to the Cullom computer name and for the first argument as you can see here cursor that

151
00:09:23,940 --> 00:09:28,390
gets Turing to these two refers to the current computer type.

152
00:09:28,620 --> 00:09:33,330
OK so I want to get these data and then assign those data to the computer object.

153
00:09:33,330 --> 00:09:38,470
And at the end in 95 I want to actually return this computer object from dismiss it.

154
00:09:38,700 --> 00:09:39,720
OK.

155
00:09:39,720 --> 00:09:41,290
So hopefully that makes sense.

156
00:09:41,370 --> 00:09:46,560
And now I'm going to paste in some other method here and then I'm going explain to you what's going

157
00:09:46,560 --> 00:09:47,200
on here.

