Samual Sam has Published 2492 Articles

Iterate through Septet class in JavaTuples

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

67 Views

Like Arrays, we can also iterate through Septet class in JavaTuples using loops.Let us first see what we need to work with JavaTuples. To work with Septet class in JavaTuples, you need to import the following package −import org.javatuples.Septet;Note − Steps to download and run JavaTuples program If you are ... Read More

What is the difference between and response.sendRedirect(url)?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

254 Views

The element forwards the request object containing the client request information from one JSP file to another file. The target file can be an HTML file, another JSP file, or a servlet, as long as it is in the same application context as the forwarding JSP file.sendRedirect sends HTTP ... Read More

MonthDay withMonth() Method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

72 Views

An immutable copy of a MonthDay with the month altered as required is done using the method withMonth() in the MonthDay class in Java. This method requires a single parameter i.e. the month that is to be set in the MonthDay and it returns the MonthDay with the month altered ... Read More

How do I insert a special character such as ' (single quote) into MySQL?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

3K+ Views

To insert a special character such as “ ‘ “ (single quote) into MySQL, you need to use \’ escape character. The syntax is as follows −insert into yourTableName(yourColumnName) values(' yourValue\’s ');To understand the above syntax, let us create two tables. The query to create first table is as follows ... Read More

The contains() method of Pair Class in JavaTuples

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

221 Views

Search a value in a Pair Class using the contains() method.Let us first see what we need to work with JavaTuples. To work with Pair class in JavaTuples, you need to import the following package −import org.javatuples.Pair;Note − Steps to download and run JavaTuples program If you are using Eclipse ... Read More

How do you implement hit counter in JSP?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

405 Views

A hit counter tells you about the number of visits on a particular page of your web site. Usually, you attach a hit counter with your index.jsp page assuming people first land on your home page.To implement a hit counter you can make use of the Application Implicit object and ... Read More

MonthDay with() Method in Java

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

57 Views

An immutable copy of a MonthDay with the month of the year altered as required is done using the method with() in the MonthDay class in Java. This method requires a single parameter i.e. the month that is to be set in the MonthDay and it returns the MonthDay with ... Read More

How to remove duplicate values inside a list in MongoDB?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

897 Views

You can use aggregate framework along with $setUnion operator. Let us first create a collection with documents −> db.removeDuplicatesDemo.insertOne({"InstructorName":"Chris", "InstructorAge":34, "InstructorSubject":    ["Java", "C", "Java", "C++", "MongoDB", "MySQL", "MongoDB"]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cb9d96c895c4fd159f80807") }Following is the query to display all documents from the collection with ... Read More

How to read a specific key-value pair from a MongoDB collection?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

765 Views

You can use dot(.) notation to read a specific key-value pair from MongoDB collection. Let us first create a collection with documents −> db.readSpecificKeyValueDemo.insertOne( ...    { ...       "_id": 100, ...       "StudentDetails": ...       { ...          "StudentFirstName" : ... Read More

JavaTuples setAt0() method for Quartet class

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:25

65 Views

The setAt0() method is used to set the Quartet value in JavaTuples and a copy with a new value at the specified index i.e. index 0 here.Let us first see what we need to work with JavaTuples. To work with Quartet class in JavaTuples, you need to import the following ... Read More

Advertisements