Karthikeya Boyini has Published 2383 Articles

Duration compareTo() method in Java

karthikeya Boyini

karthikeya Boyini

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

6K+ Views

Two durations can be compared using the compareTo() method in the Duration class in Java. This method requires a single parameter i.e. the duration to be compared.If the first duration is greater than the second duration it returns a positive number, if the first duration is lesser than the second ... Read More

ByteBuffer arrayOffset() method in Java

karthikeya Boyini

karthikeya Boyini

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

117 Views

The offset of the first element of the buffer inside the buffer array is obtained using the method arrayOffset() in the class java.nio.ByteBuffer. If the buffer backed by the array is read-only, then the ReadOnlyBufferException is thrown.A program that demonstrates this is given as follows −Example Live Demoimport java.nio.*; import java.util.*; ... Read More

How to send a html based email using a JSP page?

karthikeya Boyini

karthikeya Boyini

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

487 Views

Here is an example to send an HTML email from your machine. It is assumed that your localhost is connected to the Internet and that it is capable enough to send an email. Make sure all the jar files from the Java Email API package and the JAF package are ... Read More

Does MySQL eliminate common subexpressions between SELECT and HAVING/GROUP BY clause? How to test it?

karthikeya Boyini

karthikeya Boyini

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

42 Views

To test, use the sleep() function.Case 1 −The syntax is as follows −SELECT yourColumnName+sleep(yourIntegerValue) FROM yourTableName GROUP BY yourColumnName+sleep(yourIntegerValue);;Case 2 − You can use another syntax which is as follows −SELECT yourColumnName+sleep(yourIntegerValue) As anyAliasName FROM yourTableName GROUP BY yourAliasName;To understand the above syntaxes, let us create a table. The query ... Read More

Multiple Inserts for a single column in MySQL?

karthikeya Boyini

karthikeya Boyini

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

4K+ Views

The syntax for multiple inserts for a single column in MySQL is as follows −INSERT INTO yourTableName(yourColumnName) values(‘yourValue1'), (‘yourValue2'), (‘yourValue3'), (‘yourValue4'), .........N;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table InsertMultipleDemo -> ( ... Read More

Duration ofNanos() method in Java

karthikeya Boyini

karthikeya Boyini

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

80 Views

The duration can be obtained in a one nano second format using the ofNanos() method in the Duration class in Java. This method requires a single parameter i.e. the number of nano seconds and it returns the duration in a one nano second format. If the capacity of the duration ... Read More

JavaTuples setAt2() method for Septet class

karthikeya Boyini

karthikeya Boyini

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

66 Views

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

Instant minusNanos() method in Java

karthikeya Boyini

karthikeya Boyini

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

115 Views

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

ByteBuffer asShortBuffer() method in Java

karthikeya Boyini

karthikeya Boyini

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

112 Views

A view of the ByteBuffer can be created as a ShortBuffer using the asShortBuffer() method in the class java.nio.ByteBuffer. This method requires no parameters and it returns a short buffer as required. This buffer reflects the changes made to the original buffer and vice versa.A program that demonstrates this is ... Read More

What is JSTL?

karthikeya Boyini

karthikeya Boyini

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

960 Views

The JavaServer Pages Standard Tag Library (JSTL) is a collection of useful JSP tags which encapsulates the core functionality common to many JSP applications.JSTL has support for common, structural tasks such as iteration and conditionals, tags for manipulating XML documents, internationalization tags, and SQL tags. It also provides a framework ... Read More

Advertisements