Samual Sam has Published 2310 Articles

Get total number of rows while using LIMIT in MySQL?

Samual Sam

Samual Sam

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

1K+ Views

To get the total number of rows when using LIMIT, use the following syntax −select SQL_CALC_FOUND_ROWS * FROM yourTableName LIMIT 0, yourLastValue;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table RowsUsingLimit -> ( ... Read More

Iterate through Triplet class in JavaTuples

Samual Sam

Samual Sam

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

291 Views

The iteration in Triplet class works in the same way as Arrays collection.Let us first see what we need to work with JavaTuples. To work with Triplet class in JavaTuples, you need to import the following package −import org.javatuples.Triplet;Note − Steps to download and run JavaTuples program If you are ... Read More

How to print date and time in specific format using JSP?

Samual Sam

Samual Sam

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

1K+ Views

SimpleDateFormat is a concrete class for formatting and parsing dates in a locale-sensitive manner. SimpleDateFormat allows you to start by choosing any user-defined patterns for date-time formatting.Let us modify the above example as follows −Example Live Demo           Display Current Date & Time     ... Read More

Duration ofMinutes() method in Java

Samual Sam

Samual Sam

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

121 Views

The duration can be obtained in a one minute format using the ofMinutes() method in the Duration class in Java. This method requires a single parameter i.e. the number of minutes and it returns the duration in a one minute format. If the capacity of the duration is exceeded, then ... Read More

How to update the column of a row in a CachedRowSet object in JDBC?

Samual Sam

Samual Sam

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

685 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.You can create a Cached RowSet object using the createCachedRowSet() method ... Read More

Extract subarray value in MongoDB?

Samual Sam

Samual Sam

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

425 Views

To extract the subarray value in MongoDB, you can use $elemMatch projection operator.Let us first create a collection with documents −> db.extractSubArrayDemo.insertOne( ...    { ...       _id: 101, ...       "clientName":"Larry", ...       "ClientDetails": ...       [ ...       ... Read More

Duration toHours() method in Java

Samual Sam

Samual Sam

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

200 Views

The value of a duration in the form of a number of hours can be obtained using the method toHours() 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 hours.A program that demonstrates this ... Read More

Iterate through Septet class in JavaTuples

Samual Sam

Samual Sam

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

114 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

371 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

113 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

Advertisements