Samual Sam has Published 2310 Articles

Instant minusMillis() method in Java

Samual Sam

Samual Sam

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

217 Views

An immutable copy of a instant where some milliseconds are subtracted from it can be obtained using the minusMillis() method in the Instant class in Java. This method requires a single parameter i.e. the number of milliseconds to be subtracted and it returns the instant with the subtracted milliseconds.A program ... Read More

ByteBuffer equals() method in Java

Samual Sam

Samual Sam

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

496 Views

The equality of two buffers can be checked using the method equals() in the class java.nio.ByteBuffer. Two buffers are equal if they have the same type of elements, the same number of elements and the same sequence of elements. The method equals() returns true if the buffers are equal and ... Read More

How to send a email with attachment using a JSP page?

Samual Sam

Samual Sam

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

479 Views

Following is an example to send an email with attachment from your machine −Example Send Attachment Email using JSP ... Read More

Use JOIN to select record with more than one condition using AND?

Samual Sam

Samual Sam

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

146 Views

Let us first create a demo table −mysql> create table selectPerson    -> (    -> PersonId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> PersonName varchar(20),    -> PersonFavouriteFruit varchar(60)    -> ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command. The ... Read More

Unset an attribute from a single array element in MongoDB?

Samual Sam

Samual Sam

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

168 Views

Use $unset operator to unset an attribute. Let us first create a collection with documents −> db.unsetAnAttributeDemo.insertOne( ...    { ...       _id: 1, ...       "StudentDetails": [ ...          { ...             "StudentFirstName": "Ramit", ...     ... Read More

Duration between() method in Java

Samual Sam

Samual Sam

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

2K+ Views

The duration between two temporal objects can be obtained using the method between() in the Duration class in Java. This method requires two parameters i.e. the start duration and the end duration. Also, it returns the duration between these two temporal duration objects.A program that demonstrates this is given as ... Read More

Create Triplet Tuple from List in Java

Samual Sam

Samual Sam

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

245 Views

Use the fromCollection() to create a Triplet tuple from List Collection, but let us first see what we need Let us first see what we need to work with JavaTuples. To work with JavaTuples. Let us first see what we need to work with JavaTuples. To work with Triplet class ... Read More

Instant until() Method in Java

Samual Sam

Samual Sam

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

683 Views

The time between two instant objects can be calculated using the until() method in the Instant class in Java. This method requires two parameters i.e. the end instant and the chronological unit to measure the time. It returns the time between two instant objects.A program that demonstrates this is given ... Read More

How to create a record in MySQL database subject to TTL (Time to live) option?

Samual Sam

Samual Sam

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

4K+ Views

You need to use MySQL event scheduler. It manages the execution of events as well as scheduling.First, you need to create a table. After that you can create a event that will schedule every single day.Let us create a table. The query to create a table is as follows −mysql> ... Read More

ByteBuffer compact() method in Java

Samual Sam

Samual Sam

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

286 Views

The buffer can be compacted using the compact() method in the class java.nio.ByteBuffer. This method does not require a parameter and it returns the new compacted ByteBuffer with the same content as the original buffer. If the buffer is read-only, then the ReadOnlyBufferException is thrown.A program that demonstrates this is ... Read More

Advertisements