So as you can see here these are the lines of code that I actually pay said here.
So first of all as you can see I want to actually read some data from the database.
OK.
So as you can see I want to actually get a single computer object from the database and let the data
add here as you can see in lines of 81 through 96 as you can see we have MFX and the access modifiers
of this Smurfit is public.
As you can see here and the return type of dismay for this computer and this means that this method
is going to return an object of type computer.
OK.
And the name of this method is good computer.
So this as you can see here actually accepts an argument of type integer and the name of this argument
is ID.
Now I am actually inside of this method inside the curly braces of this method method.
So let's see what's going on here at the line 83.
As you can see here.
I created an object of type 2 like database and the name of this object is database assignment operator
these.
So this refers to this my is you a late handler class right.
That gets readable database.
So I want you to get the readable database OK.
I want to get the database in order to read the data and I want to assign that database to this database
here.
As you can see here in line 84 here.
I created this up interface here.
As you can see this is actually an interface cursor.
OK.
And here I try to initialized this cursor.
So now let's actually open and documentation and see what is this cursor interface.
So here is the documentation and you can actually enter this.
You are here on your web browser and then you will be guided to this page here.
So this is actually a cursor here and this is an interface and it actually implements this close up
an interface here.
So let's read a description it says this interface provides a random read write access to the result
set returned by your database query.
So by using this a cursor interface I can actually query data from the database.
OK so here I actually created this cursor here.
Assignment operator and then I referred to the name of this database object that query as you can see
here.
Now you want to query data from the database so query these this Meffert this query if it actually accepts
some arguments.
The first argument is actually table computer as you can see here.
This is the table computer.
This is going to be the name of the table.
OK.
That you want to actually get the data up from this database.
So now I want to actually call this method here again in order to show you the arguments.
So database that query.
So the first argument is going to be the table as you can see here strength table.
The second argument is going to be the columns that are inside of that table.
So here as you can see for the second argument I created an object of type upstreams Aure as you can
see for the second argument we need on a string at a which actually includes the columns that are inside
of that table.
So here I created a string Arey object new string ID and inside the curly braces I assigned these objects
that are inside of this at 8.
So that's the first one is column ID.
The second one is going to be column computer name and the third one is going to be Cullom a computer
type.
OK these are the columns.
This is very important for the second argument and for the first argument we need to provide string
selection.
We need to provide a WHERE clause and of classes actually determines how we want to actually get the
data from the database.
For example as you can see here for the first argument which is actually this is actually of type streambed.
And it says its name is selection.
So I want to actually I used to refer to the name of this column column Id plus.
And instead of double quotes on an equal operator here and then a question mark.
And this means all you want to get this specific computer object that is actually related to a specific
ID.
Ok for example I want to actually get the first computer object that its ID is number one.
OK.
So in this way I can I try to get that computed object by providing the ID I can actually get the computer
object.
And that's why I actually specified that this is going to accept an argument of type integer and the
name of this argument is ID.
So by providing an ID for this method I can actually get this specific computed object.
So that's the job of this very close here.
Column ID plus an instead of double quotes like with an equal operator and the question mark.
And this means that by providing an ID for the Smurfit is going to give me the specific computed object
that is related to this ID.
OK.
And here as you can see for the argument here we have this selection artics.
OK.
So we need to actually provide arguments for these of our class here for this fair argument.
So these are the arguments Neal which is actually of type string at a right.
So we need to actually create an object of type string at a new string at a.
And inside the curly braces we need to provide the objects three image that the value of ID the Smurfit
this string that value of method actually accept a value of type integer and then it's going to return
a string value from that integer value.
So this I actually referred to the name of the string class that value of this value of is actually
a static method inside the string class and it's going to accept a value of type integer.
So here I passed this value ID which is actually integer and it's going to convert that value to a string
value.
So it's going to give me the string representation of that idea.
OK.
So this argument this representation of that idea is going to be an argument for this class.
Yet as you can see Klallam Plus the equal operator question.
This is going to be an argument for this one.
And this means I want to actually get the ID that it's related to a specific computer object and I want
to return that computer object.
OK.
And here for for these arguments I assigned the value for example for this group by having an order
by.
OK.
Are you saying that value not because we don't need them.
And here at the end of my statement I actually put a semicolon.
OK.
So in actuality this line of code here and here I created an if statement here and it's as if cursor
this cursor here as you can see this interface as you can see here is not equal to null.
OK cursor move to first.
So this means that if we actually have some optics inside our database OK and we can actually read those
data then it's going to go to their first object inside the database.
Inside it is like database.
If the cursor is equal to null then it's not going to actually go inside the database and read the data
because we don't have data in our database.
OK so this has been important.
And in light 93 here I created an object of type computer.
So tell me about this if it is going to return an update of the computer.
If we pass the ID to the Smurfette and then it's going to return an object that is actually specific
to that ID and then we can actually get that computed object.
So in 93 I created an object of type computer assignment operator.
And here I actually initialize this computer Optix new computer.
So here we are actually providing free arguments for the constructor of this computer class.
So inside this computer class remember that you had three constructors as you can see here and here
in say this is tool like handler class.
I want to call this one constructor that that actually accepts free arguments which is the computer
name and computer type.
So here as you can see new computer.
And for the first argument we need to provide the ID.
So I called this integer class data parsing.
So this is going to accept a string value and then it's going to convert.
That's why the gateway integer value so integer that parse.
And for the argument of this parsing in Smurfette you refer to the name of this cursor object as you
can see here cursor that get strange.
So it's going to get this string representation of the first column the first column is actually column
Id.
As you can see here.
So it's going to give me that string representation of that ID.
OK.
Which is going to be an integer value.
So it's going to dismiss that person is going on is going to convert that's by the value to the integer
value.
And then we can actually put that's about you as the id of the constructor and for the second argument
we need to think about your computer name.
So inside this computer class as you can see for the second value of the second argument we need a string
value computer name and for the first argument we need a string value again for the for the first argument.
OK so this is the second argument as you can see here.
String computer.
And this is the first argument.
So if you say this is like handler class for the second argument cursor that get string 1.
This one refers to the Cullom computer name and for the first argument as you can see here cursor that
gets Turing to these two refers to the current computer type.
OK so I want to get these data and then assign those data to the computer object.
And at the end in 95 I want to actually return this computer object from dismiss it.
OK.
So hopefully that makes sense.
And now I'm going to paste in some other method here and then I'm going explain to you what's going
on here.