Karthikeya Boyini has Published 2193 Articles

Duration isZero() method in Java

karthikeya Boyini

karthikeya Boyini

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

129 Views

It can be checked if the duration is of zero length or not using the isZero() method in the Duration class in Java. This method requires no parameters. Also, it returns true if the duration is of zero length and false otherwise.A program that demonstrates this is given as follows ... Read More

How to insert data into a CachedRowSet in JDBC? Explain?

karthikeya Boyini

karthikeya Boyini

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

703 Views

The CachedRowSet is the base implementation of disconnected row sets. It connects to the data source, reads data from it, disconnects with the data source and the processes the retrieved data, reconnects to the data source and writes the modifications.Creating a CachedRowSetYou can create a Cached RowSet object using the ... Read More

MongoDB query to get specific month|year (not date)?

karthikeya Boyini

karthikeya Boyini

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

692 Views

You can use aggregate framework along with $month projection operator. Let us first create a collection with documents −> db.specificMonthDemo.insertOne({"StudentName":"Larry", "StudentDateOfBirth":new ISODate('1995-01-12')}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cb9a9ca8f1d1b97daf71819") } > db.specificMonthDemo.insertOne({"StudentName":"Chris", "StudentDateOfBirth":new ISODate('1999-12-31')}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cb9a9db8f1d1b97daf7181a") } > db.specificMonthDemo.insertOne({"StudentName":"David", "StudentDateOfBirth":new ISODate('2000-06-01')}); ... Read More

Duration equals() method in Java

karthikeya Boyini

karthikeya Boyini

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

361 Views

The equality of two durations can be determined using the equals() method in the Duration class in Java. This method requires a single parameter i.e. the duration to be compared. Also, it returns true if both the durations are equal and false otherwise.A program that demonstrates this is given as ... Read More

Search a value in JavaTuples Septet class

karthikeya Boyini

karthikeya Boyini

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

81 Views

The contain() method is used to search a value in Septet class.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 using ... Read More

What is JSP page redirection?

karthikeya Boyini

karthikeya Boyini

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

403 Views

Page redirection is generally used when a document moves to a new location and we need to send the client to this new location. This can be because of load balancing, or for simple randomization.The simplest way of redirecting a request to another page is by using sendRedirect() method of ... Read More

MonthDay toString() Method in Java

karthikeya Boyini

karthikeya Boyini

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

164 Views

The string value of the MonthDay object can be obtained using the method toString() in the MonthDay class in Java. This method requires no parameters and it returns the string value of the MonthDay object.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; public class Demo { ... Read More

Duration toMinutes() method in Java

karthikeya Boyini

karthikeya Boyini

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

230 Views

The value of a duration in the form of a number of minutes can be obtained using the method toMinutes() in the Duration class in Java. This method does not require any parameters and it returns the duration in the form of a number of minutes.A program that demonstrates this ... Read More

Search a value in Java Pair Tuple

karthikeya Boyini

karthikeya Boyini

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

191 Views

Use the contains() method to search a value in JavaTuples Pair class.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 ... Read More

What is a hit count for a Webpage?

karthikeya Boyini

karthikeya Boyini

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

829 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

Advertisements